From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbdAaLFD (ORCPT ); Tue, 31 Jan 2017 06:05:03 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33719 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751513AbdAaLEw (ORCPT ); Tue, 31 Jan 2017 06:04:52 -0500 From: Maksymilian Piechota X-Google-Original-From: Maksymilian Piechota Date: Tue, 31 Jan 2017 06:04:01 -0500 To: Joe Perches Cc: Greg Kroah-Hartman , Maksymilian Piechota , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: Re: [PATCH 001] staging: wlan-ng: Add tabstop preceding the statement Message-ID: <20170131110358.GA11278@maks-debian.localdomain> References: <20170130163142.GA9425@maks-debian.localdomain> <20170130164423.GA12941@kroah.com> <1485835236.20550.20.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1485835236.20550.20.camel@perches.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 30, 2017 at 08:00:36PM -0800, Joe Perches wrote: > On Mon, 2017-01-30 at 17:44 +0100, Greg Kroah-Hartman wrote: > > On Mon, Jan 30, 2017 at 11:31:42AM -0500, Maksymilian Piechota wrote: > > > This patch fixes the checkpatch.pl warning: > > > > > > WARNING: Statements should start on a tabstop > > > > > > Signed-off-by: Maksymilian Piechota > > > --- > > > drivers/staging/wlan-ng/prism2mgmt.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c > > > index 16fb2d3..2d67125 100644 > > > --- a/drivers/staging/wlan-ng/prism2mgmt.c > > > +++ b/drivers/staging/wlan-ng/prism2mgmt.c > > > @@ -1308,7 +1308,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) > > > hw->sniffhdr = 0; > > > wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; > > > } else > > > - if ((msg->wlanheader.status == > > > + if ((msg->wlanheader.status == > > > P80211ENUM_msgitem_status_data_ok) > > > && (msg->wlanheader.data == P80211ENUM_truth_true)) { > > > hw->sniffhdr = 1; > > > > Hm, this all doesn't look correct now, does it? Please fix up the whole > > if statement here. > > Ideally, it'd look something like: > > /* Set the driver state */ > /* Do we want the prism2 header? */ > if (msg->prismheader.status == P80211ENUM_msgitem_status_data_ok && > msg->prismheader.data == P80211ENUM_truth_true) { > hw->sniffhdr = 0; > wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; > } else if (msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok && > msg->wlanheader.data == P80211ENUM_truth_true) { > hw->sniffhdr = 1; > wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; > } else { > wlandev->netdev->type = ARPHRD_IEEE80211; > } > > with the unnecessary parentheses removed, > the logical continuations at the end-of-line, > and the else if on a single line. > I must admit it looks better, but this way we get 2 warnings instead of 1 (before my changes). What is the policy? Can we ignore more warnings in order to get cleaner code?