lkml.org 
[lkml]   [2016]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/8] Staging: rts5208: rtsx_transport.c: Align to open parenthesis
From
Date
On Thu, 2016-02-11 at 20:07 -0800, Shaun Ren wrote:
> This patch fixes the alignment issue reported by checkpatch.pl:
>
> CHECK: Alignment should match open parenthesis
[]
> diff --git a/drivers/staging/rts5208/rtsx_transport.c b/drivers/staging/rts5208/rtsx_transport.c
[]
> @@ -52,12 +55,14 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
>   if (*offset >= scsi_bufflen(srb))
>   return 0;
>   cnt = min(buflen, scsi_bufflen(srb) - *offset);
> +
> + unsigned char *sgbuffer = (unsigned char *)scsi_sglist(srb) +
> + *offset;

Please don't declare variables in the middle of functions.
Variable declarations are only done at the beginning of functions.

> +
>   if (dir == TO_XFER_BUF)
> - memcpy((unsigned char *) scsi_sglist(srb) + *offset,
> - buffer, cnt);
> + memcpy(sgbuffer, buffer, cnt);
>   else
> - memcpy(buffer, (unsigned char *) scsi_sglist(srb) +
> - *offset, cnt);
> + memcpy(buffer, sgbuffer, cnt);
>   *offset += cnt;

\
 
 \ /
  Last update: 2016-02-12 06:21    [W:0.086 / U:5.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site