Re: [PATCH] serial: core: Fix serial_base_match() after fixing controller port name

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

 



On Wed, Aug 02, 2023 at 03:48:26PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Aug 02, 2023 at 02:48:43PM +0300, Tony Lindgren wrote:
> > While fixing DEVNAME to be more usable, I broke serial_base_match() as
> > the ctrl and port prefix for device seemed unnecessary.
> > 
> > Let's fix the issue by checking against dev->type and drv->name.

...

> > +	    !strncmp(SERIAL_BASE_CTRL_NAME, drv->name, 4))
> 
> maybe:
> 	    !strncmp(SERIAL_BASE_CTRL_NAME, drv->name, strlen(SERIAL_BASE_CTRL_NAME))
> 
> as "4" is a magic number :)

str_has_prefix() hides that.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux