From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756689AbcBJC6R (ORCPT ); Tue, 9 Feb 2016 21:58:17 -0500 Received: from smtprelay0232.hostedemail.com ([216.40.44.232]:40350 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752727AbcBJC6P (ORCPT ); Tue, 9 Feb 2016 21:58:15 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:69:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3354:3622:3865:3867:3868:3872:3873:4321:4605:5007:6119:6261:7903:10004:10400:10848:11026:11232:11473:11658:11783:11914:12043:12296:12438:12517:12519:12555:12683:12740:13255:13894:14110:14659:21080:30054:30064:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: bed20_d864287b524b X-Filterd-Recvd-Size: 3462 Message-ID: <1455073091.3333.24.camel@perches.com> Subject: Re: [PATCH v3 2/9] Staging: rts5208: rtsx_transport.c: Align to open parenthesis From: Joe Perches To: Shaun Ren , gregkh@linuxfoundation.org, rjui@broadcom.com Cc: sbranden@broadcom.com, jonmason@broadcom.com, mahfouz.saif.elyazal@gmail.com, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org Date: Tue, 09 Feb 2016 18:58:11 -0800 In-Reply-To: <1455072328-7033-3-git-send-email-shaun.ren@linux.com> References: <1454981485-15686-1-git-send-email-shaun.ren@linux.com> <1455072328-7033-1-git-send-email-shaun.ren@linux.com> <1455072328-7033-3-git-send-email-shaun.ren@linux.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.3-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-02-09 at 18:45 -0800, Shaun Ren wrote: > This patch fixes the alignment issue reported by checkpatch.pl: > > CHECK: Alignment should match open parenthesis > > Signed-off-by: Shaun Ren > --- >  drivers/staging/rts5208/rtsx_transport.c | 61 ++++++++++++++++++-------------- >  1 file changed, 35 insertions(+), 26 deletions(-) > > diff --git a/drivers/staging/rts5208/rtsx_transport.c b/drivers/staging/rts5208/rtsx_transport.c > index 5de8913..17bea8a 100644 > --- a/drivers/staging/rts5208/rtsx_transport.c > +++ b/drivers/staging/rts5208/rtsx_transport.c > @@ -42,8 +42,11 @@ >   */ >   >  unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer, > - unsigned int buflen, struct scsi_cmnd *srb, unsigned int *index, > - unsigned int *offset, enum xfer_buf_dir dir) > +        unsigned int buflen, > +        struct scsi_cmnd *srb, > +        unsigned int *index, > +        unsigned int *offset, > +      enum xfer_buf_dir dir) Doesn't this look odd to you? >  { >   unsigned int cnt; >   > @@ -54,10 +57,10 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer, >   cnt = min(buflen, scsi_bufflen(srb) - *offset); >   if (dir == TO_XFER_BUF) >   memcpy((unsigned char *) scsi_sglist(srb) + *offset, > - buffer, cnt); > +        buffer, cnt); >   else >   memcpy(buffer, (unsigned char *) scsi_sglist(srb) + > - *offset, cnt); > +        *offset, cnt); If you really want to make this look nicer and more intelligible, it's probably be better to use a more symmetric form like: if (dir == TO_XFER_BUF) memcpy((unsigned char *)scsi_sglist(srb) + *offset, buffer, cnt); else memcpy(buffer, (unsigned char *)scsi_sglist(srb) + *offset, cnt); or maybe void *to; void *from; [...] if (dir == TO_XFER_BUF) { to = (unsigned char *)scsi_sglist(srb) + *offset; from = buffer; } else { to = buffer; from = (unsigned char *)scsi_sglist(srb) + *offset; } memcpy(to, from, cnt); or maybe void *to; void *from; [...] to = (unsigned char *)scsi_sglist(srb) + *offset; from = buffer; if (dir != TO_XFER_BUF) swap(to, from); memcpy(to, from, cnt);