Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751822AbdG1Ke3 (ORCPT ); Fri, 28 Jul 2017 06:34:29 -0400 Received: from smtprelay0032.hostedemail.com ([216.40.44.32]:46670 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751660AbdG1Ke2 (ORCPT ); Fri, 28 Jul 2017 06:34:28 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:966:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3872:4321:4385:5007:7903:10004:10400:10848:11026:11232:11658:11914:12043:12114:12296:12438:12740:12760:12895:13069:13311:13357:13439:14659:14721:21080:21433:21627:30012:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: fold33_995b72187109 X-Filterd-Recvd-Size: 2043 Message-ID: <1501238064.5368.57.camel@perches.com> Subject: Re: [PATCH] drivers:staging:wlan-ng Correct multiple line dereference From: Joe Perches To: janani-sankarababu , gregkh@linuxfoundation.org Cc: sergio.paracuellos@gmail.com, davem@davemloft.net, adrien.descamps@gmail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Fri, 28 Jul 2017 03:34:24 -0700 In-Reply-To: <1501236207-27677-1-git-send-email-jananis37@gmail.com> References: <1501236207-27677-1-git-send-email-jananis37@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1120 Lines: 31 On Fri, 2017-07-28 at 15:33 +0530, janani-sankarababu wrote: > This patch fixes multiple line dereference Warning reported by checkpath script. This has been made to simplify the code and make it more readable. Please wrap your commit messages to 75 characters per line. And run your suggested patches though checkpatch too. > diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c [] > @@ -1345,15 +1345,13 @@ static int hfa384x_usbctlx_complete_sync(struct hfa384x *hw, > kfree(ctlx); > } else if (mode == DOWAIT) { > struct usbctlx_cmd_completor completor; > + struct usbctlx_completor *cmplt; > + > + cmplt = init_cmd_completor(&completor, &ctlx->inbuf.cmdresp, > + &cmd->result); > > result = > - hfa384x_usbctlx_complete_sync(hw, ctlx, > - init_cmd_completor(&completor, > - &ctlx-> > - inbuf. > - cmdresp, > - &cmd-> > - result)); > + hfa384x_usbctlx_complete_sync(hw, ctlx, cmplt); This should now be a single line result = hfa384x_usbctlx_complete_sync(hw, ctlx, cmplt);