Re: [PATCH 2/2] pi433: Fix indentation according to coding style

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

 



On Tue, Dec 03, 2019 at 09:14:17PM +0300, Dan Carpenter wrote:
> You can't have two patches with the same subject.
> 
> On Tue, Dec 03, 2019 at 06:54:49PM +0100, Sven Leykauf wrote:
> > Fix indentation so that no line exceeds the 80 character border.
> > 
> > Put the return command one line under the default case, so it looks
> > better.
> > 
> > Co-developed-by: Daniel Bauer <daniel.j.bauer@xxxxxx>
> > Signed-off-by: Daniel Bauer <daniel.j.bauer@xxxxxx>
> > Signed-off-by: Sven Leykauf <sven_leykauf1@xxxxxx>
> > ---
> >  drivers/staging/pi433/rf69.c | 56 ++++++++++++++++++++++++------------
> >  1 file changed, 37 insertions(+), 19 deletions(-)
> > 
> > diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> > index 6b13f92028c7..6cdd46682aa9 100644
> > --- a/drivers/staging/pi433/rf69.c
> > +++ b/drivers/staging/pi433/rf69.c
> > @@ -596,42 +596,60 @@ bool rf69_get_flag(struct spi_device *spi, enum flag flag)
> >  {
> >  	switch (flag) {
> >  	case mode_switch_completed:
> > -		return (rf69_read_reg(spi, REG_IRQFLAGS1) & MASK_IRQFLAGS1_MODE_READY);
> > +		return (rf69_read_reg(spi, REG_IRQFLAGS1) &
> > +				MASK_IRQFLAGS1_MODE_READY);

For patch 1 it would be pretty easy to re-write the function to be
cleaner and under 80 characters.  For this function it's quite a bit
trickier.  You could sit for a long time thinking about it.

Is MASK_IRQFLAGS1_MODE_READY the exact perfect name?  Why does the
"enum flag flag" enum exist?  Is it perfectly named?  How much of this
function is dead code?

It's probably better to start cleaning up the rest of the driver and
then by the time you get back to this function maybe the answer will
be obvious.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux