Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760737AbbBJAeM (ORCPT ); Mon, 9 Feb 2015 19:34:12 -0500 Received: from mga11.intel.com ([192.55.52.93]:47439 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbbBJAeK convert rfc822-to-8bit (ORCPT ); Mon, 9 Feb 2015 19:34:10 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,547,1418112000"; d="scan'208";a="649770476" From: "Drokin, Oleg" To: "" CC: Tal Shorer , Dan Carpenter , "" , "Dilger, Andreas" , "" , "" Subject: Re: [PATCH v3] staging: lustre: fix coding style errors Thread-Topic: [PATCH v3] staging: lustre: fix coding style errors Thread-Index: AQHQRIzBEgi6FP3c402TdLH5zpe8oZzpXUgAgAAySgA= Date: Tue, 10 Feb 2015 00:34:07 +0000 Message-ID: <452EBC1C-3FEF-4D29-8780-606021377B26@intel.com> References: <20150209213408.GA11071@kroah.com> In-Reply-To: <20150209213408.GA11071@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.14.148] Content-Type: text/plain; charset="us-ascii" Content-ID: <826BD1A5450B64418CA9C6308B5B3DD2@intel.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1916 Lines: 48 On Feb 9, 2015, at 4:34 PM, 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 */ static int __proc_dump_kernel(void *data, int write, @@ -521,7 +521,7 @@ static struct ctl_table lnet_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .extra1 = &min_watchdog_ratelimit, + .extra1 = &zero, /* Disable ratelimiting */ .extra2 = &max_watchdog_ratelimit, }, { Bye, Oleg-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/