Re: [PATCH 001] staging: wlan-ng: Add tabstop preceding the statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <maksymilianpiechota@xxxxxxxxx>
> > ---
> >  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.

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux