Re: [PATCH v7 4/7] serial: core: Add support for DEVNAME:0.0 style naming for kernel console

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

 



On Mar 28, 2024 at 08:22:26 +0100, Greg Kroah-Hartman wrote:
> On Thu, Mar 28, 2024 at 12:01:52PM +0530, Dhruva Gole wrote:
> > Hi,
> > 
> > On Mar 27, 2024 at 12:59:38 +0200, Tony Lindgren wrote:
> > > We can now add hardware based addressing for serial ports. Starting with
> > > commit 84a9582fd203 ("serial: core: Start managing serial controllers to
> > > enable runtime PM"), and all the related fixes to this commit, the serial
> > > core now knows to which serial port controller the ports are connected.
[...]
> > >  
> > > +#ifdef CONFIG_SERIAL_CORE_CONSOLE
> > > +
> > > +static int serial_base_add_one_prefcon(const char *match, const char *dev_name,
> > > +				       int port_id)
> > > +{
> > > +	int ret;
> > > +
> > > +	ret = add_preferred_console_match(match, dev_name, port_id);
> > > +	if (ret == -ENOENT)
> > > +		return 0;
> > > +
> > > +	return ret;
> > 
> > Can we do this instead?
> > return (ret == -ENOENT ? 0 : ret);
> 
> No, please no.
> 
> Just spell it out, like was done here, dealing with ? : is a pain to
> read and follow and the generated code should be identical.
> 
> Only use ? : in places where it's the only way to do it (i.e. as
> function parameters or in printk-like lines.)
> 
> Write for people first, compilers second.

Okay understood, I will keep this in mind from now on.
Thanks.

Tony,
Please feel free to take my R-by and ignore this suggestion as per
Greg's comments.

-- 
Best regards,
Dhruva




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux