Re: [PATCH 4/6] RDMA/core: Use dev_name instead of ibdev->name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 26, 2018 at 09:10:50AM -0400, Dennis Dalessandro wrote:
> On 9/20/2018 6:42 PM, Jason Gunthorpe wrote:
> >   	list_for_each_entry(device, &device_list, core_list)
> > -		if (!strncmp(name, device->name, IB_DEVICE_NAME_MAX))
> > +		if (!strcmp(name, dev_name(&device->dev)))
> >   			return device;
> 
> Should you continue with the strncmp here? I'm OK either way though really.

Both strings are NULL terminated, so there is no reason to use
strncmp, it will just give a false positive if one of the strings is
too long.

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux