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