public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "<gregkh@linuxfoundation.org>" <gregkh@linuxfoundation.org>
To: "Drokin, Oleg" <oleg.drokin@intel.com>
Cc: Tal Shorer <tal.shorer@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	"<devel@driverdev.osuosl.org>" <devel@driverdev.osuosl.org>,
	"Dilger, Andreas" <andreas.dilger@intel.com>,
	"<linux-kernel@vger.kernel.org>" <linux-kernel@vger.kernel.org>,
	"<clabbe.montjoie@gmail.com>" <clabbe.montjoie@gmail.com>
Subject: Re: [PATCH v3] staging: lustre: fix coding style errors
Date: Tue, 10 Feb 2015 08:52:36 +0800	[thread overview]
Message-ID: <20150210005236.GC10543@kroah.com> (raw)
In-Reply-To: <452EBC1C-3FEF-4D29-8780-606021377B26@intel.com>

On Tue, Feb 10, 2015 at 12:34:07AM +0000, Drokin, Oleg wrote:
> 
> On Feb 9, 2015, at 4:34 PM, <gregkh@linuxfoundation.org> wrote:
> >> There's a third coding style error in this file which I've chosen to
> >> not fix for clarity's sake. It is: initializing min_watchdog_ratelimit
> >> (static int) to 0
> > 
> > Please fix that too, it's not correct.  Drop the comment there if you
> > think that's confusing.
> 
> What's not correct there, I wonder? Just assignment of 0 to a static variable
> to get some extra clarity?
> The code in the question is:
> 
> static int min_watchdog_ratelimit = 0;    /* disable ratelimiting */
> static int max_watchdog_ratelimit = (24*60*60); /* limit to once per day */
> 
> So if you drop both = 0 and the comment, I think it would become even more cryptic?
> 
> How about something like this then (not a proper patch, but just to demonstrate
> the idea):
> 
> --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
> +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
> @@ -165,7 +165,7 @@ static int proc_dobitmasks(struct ctl_table *table, int write,
>                                  __proc_dobitmasks);
>  }
>  
> -static int min_watchdog_ratelimit = 0;   /* disable ratelimiting */
> +static int zero;
>  static int max_watchdog_ratelimit = (24*60*60); /* limit to once per day */

Ick, no, just do like other places have done:
  static int min_watchdog_ratelimit;	/* = 0 disable ratelimiting */


      reply	other threads:[~2015-02-10  0:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 17:20 [PATCH v3] staging: lustre: fix coding style errors Tal Shorer
2015-02-09 21:34 ` <gregkh@linuxfoundation.org>
2015-02-10  0:34   ` Drokin, Oleg
2015-02-10  0:52     ` <gregkh@linuxfoundation.org> [this message]

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=20150210005236.GC10543@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andreas.dilger@intel.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    --cc=tal.shorer@gmail.com \
    /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