[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150210005236.GC10543@kroah.com>
Date: Tue, 10 Feb 2015 08:52:36 +0800
From: "<gregkh@...uxfoundation.org>" <gregkh@...uxfoundation.org>
To: "Drokin, Oleg" <oleg.drokin@...el.com>
Cc: Tal Shorer <tal.shorer@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
"<devel@...verdev.osuosl.org>" <devel@...verdev.osuosl.org>,
"Dilger, Andreas" <andreas.dilger@...el.com>,
"<linux-kernel@...r.kernel.org>" <linux-kernel@...r.kernel.org>,
"<clabbe.montjoie@...il.com>" <clabbe.montjoie@...il.com>
Subject: Re: [PATCH v3] staging: lustre: fix coding style errors
On Tue, Feb 10, 2015 at 12:34:07AM +0000, Drokin, Oleg wrote:
>
> On Feb 9, 2015, at 4:34 PM, <gregkh@...uxfoundation.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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists