DriverDev-Devel Archive on lore.kernel.org
 help / color / 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
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 index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 17:54 [PATCH 1/2] " 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 publically 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

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git