driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sven Leykauf <sven_leykauf1@web.de>
Cc: devel@driverdev.osuosl.org, Daniel Bauer <daniel.j.bauer@fau.de>,
	linux-kernel@i4.cs.fau.de
Subject: Re: [PATCH 2/2] pi433: Fix indentation according to coding style
Date: Tue, 3 Dec 2019 21:30:56 +0300	[thread overview]
Message-ID: <20191203183056.GH1787@kadam> (raw)
In-Reply-To: <20191203181417.GD1765@kadam>

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@fau.de>
> > Signed-off-by: Daniel Bauer <daniel.j.bauer@fau.de>
> > Signed-off-by: Sven Leykauf <sven_leykauf1@web.de>
> > ---
> >  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@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2019-12-03 18:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 17:54 [PATCH 1/2] pi433: Fix indentation according to coding style Sven Leykauf
2019-12-03 17:54 ` [PATCH 2/2] " Sven Leykauf
2019-12-03 18:14   ` Dan Carpenter
2019-12-03 18:30     ` Dan Carpenter [this message]
2019-12-03 18:06 ` [PATCH 1/2] " Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191203183056.GH1787@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=daniel.j.bauer@fau.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@i4.cs.fau.de \
    --cc=sven_leykauf1@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).