Netdev List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Akshay Sarode <akshaysarode21@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] Checkpatch: coding style errors in Nvidia ethernet driver
Date: Fri, 10 Oct 2014 10:04:59 -0700	[thread overview]
Message-ID: <1412960699.8770.33.camel@joe-AO725> (raw)
In-Reply-To: <20141010164515.GA3596@linux.akshay.com>

On Fri, 2014-10-10 at 22:15 +0530, Akshay Sarode wrote:
> On Fri, Oct 10, 2014 at 08:03:07AM -0700, Joe Perches wrote:
> > On Fri, 2014-10-10 at 13:31 +0530, Akshay Sarode wrote:
> > > ERROR: "foo* bar" should be "foo *bar"
> > > ERROR: do not initialise statics to 0 or NULL
> > > CHECK: spinlock_t definition without comment
> > > Signed-off-by: Akshay Sarode <akshaysarode21@gmail.com>
> > []
> > > diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
> > []
> > > @@ -911,12 +913,18 @@ enum {
> > []
> > >  /*
> > >   * Debug output control for tx_timeout
> > >   */
> > > -static bool debug_tx_timeout = false;
> > > +enum {
> > > +	NV_DEBUG_TX_TIMEOUT_DISABLED,
> > > +	NV_DEBUG_TX_TIMEOUT_ENABLED
> > > +};
> > > +
> > > +static bool debug_tx_timeout = NV_DEBUG_TX_TIMEOUT_DISABLED;
> > 
> > Adding this enum is not useful.
> > 
> Sorry, If I may have not checked the code properly. I am a newbie here and I was hoping to start with checking coding styles.

No worries, welcome.

Starting with fixing a coding style defect or three is
just fine to learn how to compile and test the kernel.

But generally it's more useful to find things that make
the code better, more readable, smaller, faster, etc.

Also if you have some functional defect or enhancement
to implement, that's even better still.

> I'll check again.

Using an enum for a bool isn't very sensible.
true/false exist already.

>  Also there are a whole lot of warnings for line over 80 characters.

I wouldn't bother with long line conversions unless
you're doing something else at the same time.

If you want to do them for the practice, please do
them on files in drivers/staging/.

  reply	other threads:[~2014-10-10 17:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  8:01 [PATCH 1/1] Checkpatch: coding style errors in Nvidia ethernet driver Akshay Sarode
2014-10-10 15:03 ` Joe Perches
2014-10-10 16:45   ` Akshay Sarode
2014-10-10 17:04     ` Joe Perches [this message]
2014-10-10 18:25 ` David Miller

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=1412960699.8770.33.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=akshaysarode21@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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