From patchwork Sun Aug 21 07:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9292055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A1D7607FF for ; Sun, 21 Aug 2016 07:26:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 647D3284F8 for ; Sun, 21 Aug 2016 07:26:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 458842893B; Sun, 21 Aug 2016 07:26:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1A0A284F8 for ; Sun, 21 Aug 2016 07:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbcHUH0M (ORCPT ); Sun, 21 Aug 2016 03:26:12 -0400 Received: from mout.web.de ([212.227.17.11]:64408 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbcHUH0L (ORCPT ); Sun, 21 Aug 2016 03:26:11 -0400 Received: from [192.168.1.3] ([77.181.85.179]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0M4ZPc-1bEKU93y4C-00yliQ; Sun, 21 Aug 2016 09:25:54 +0200 Subject: [PATCH 5/7] aacraid: Add spaces after control flow keywords To: linux-scsi@vger.kernel.org, aacraid@microsemi.com, "James E. J. Bottomley" , "Martin K. Petersen" References: <566ABCD9.1060404@users.sourceforge.net> <40d8607f-3934-c31f-3791-ef6a67d65d45@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <086097eb-5f5a-a10c-89e6-7bef81f36779@users.sourceforge.net> Date: Sun, 21 Aug 2016 09:25:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <40d8607f-3934-c31f-3791-ef6a67d65d45@users.sourceforge.net> X-Provags-ID: V03:K0:CAfMSIpv8MVIHHtaemb/2ZCK8wEBUhukRwZeyzL5WSMeSfo1iPd cTi8IVjfi/qTwrOu0w7Z+Zm1hL73dNIxXMfSRMoa4vfjL4TL1WqbakxpxneduXSprtK773y Yi8vvKJdUx2PjQnId0Q3uGLiM69WSS/VQJCUGYUb4/m+FAzcZWbWhfgaT/akI3ycf1mGgTv LaNStxw3vUndCcbqdIDjw== X-UI-Out-Filterresults: notjunk:1; V01:K0:51CcyZXsv5s=:ni5qb4R8ChV2ZRZlal4zUk PHURbOtY0aUtooTywT2wMd71MMDij02iHY8gRyI71dcZkVQ1G0seATe0V/BNSnXDQ/+gIlRg2 3IgPnZLZ6tvnJn3rO+oJLoJqIZDUOm/0Fev+lV+MgwbvTcTMhBKzwlrk5tMF0duqHOzGC0ure XMGqo9/uw6DN83MudMOH01XyP52W8IMa3bCC4jTzNqwIMDauZFG3vkFCyIiBwSZ8/X0qay0YX E1NXauegck/iFTFjaL3rCsIYa2E2ocbDaN4s/JwVRkYWiEOXbUVf8tobvd+00RxhXrsm6hDs9 +VdN1iL5dB23SeULTn5BdsN+mjBDICPm0HImpoz6Fj+2KOGN4t+ltU05Xze7/0KvstzQZICJQ lpp5VpHNZMHTeShqqNEfABCYoZAlvEEizRiE0NgDTHrm/MlnF5jaligih8RXQEieqD2u+wFIb 7XQUy5ULcx1PLHlP6UCOEgTVuPKGBwM4FIctbXlpTnFpcThwNyyjU8ZbB7SYmovKoeepTOn+q O25Lkhw4JvQYB7JDGNmCEf/BTnKHjie4THlPwqKfnMJmjdY+sz1K6zIM7BQBQ8igYc1fnylTd lSylXUw6DtZgpS1VPYSoP/oi5Bu/FbcIsCp1lkt3KxfvfTQSC55aKPr7QnoQMUbsC3Xdyuh+z F8UVHftJQey/pmDb/5TInwfPyYpnMD/6/OfyU9EkAHAA+O+YIwqZFXMVXhyC4xH66zj9BFaW9 hSqXXggeWO5D4eyePrg2dE4aiM1bV6y4Jfq9wNtG3P8pJn5Cs5DrtrE8x2P90zkWPti006Omc AIF1XUw Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 21 Aug 2016 07:10:43 +0200 Keywords which belong to the category "control flow" in the C programming language should be followed by a space character according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/scsi/aacraid/commctrl.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c index 9f4ddb0..cda03f0 100644 --- a/drivers/scsi/aacraid/commctrl.c +++ b/drivers/scsi/aacraid/commctrl.c @@ -251,7 +251,7 @@ static int next_getadapter_fib(struct aac_dev * dev, void __user *arg) struct list_head * entry; unsigned long flags; - if(copy_from_user((void *)&f, arg, sizeof(struct fib_ioctl))) + if (copy_from_user((void *)&f, arg, sizeof(struct fib_ioctl))) return -EFAULT; /* * Verify that the HANDLE passed in was a valid AdapterFibContext @@ -280,7 +280,7 @@ static int next_getadapter_fib(struct aac_dev * dev, void __user *arg) return -EINVAL; } - if((fibctx->type != FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT) || + if ((fibctx->type != FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT) || (fibctx->size != sizeof(struct aac_fib_context))) { spin_unlock_irqrestore(&dev->fib_lock, flags); dprintk ((KERN_INFO "Fib Context corrupt?\n")); @@ -327,7 +327,7 @@ return_fib: ssleep(1); } if (f.wait) { - if(down_interruptible(&fibctx->wait_sem) < 0) { + if (down_interruptible(&fibctx->wait_sem) < 0) { status = -ERESTARTSYS; } else { /* Lock again and retry */ @@ -404,7 +404,7 @@ static int close_getadapter_fib(struct aac_dev * dev, void __user *arg) entry = dev->fib_list.next; fibctx = NULL; - while(entry != &dev->fib_list) { + while (entry != &dev->fib_list) { fibctx = list_entry(entry, struct aac_fib_context, next); /* * Extract the fibctx from the input parameters @@ -418,7 +418,7 @@ static int close_getadapter_fib(struct aac_dev * dev, void __user *arg) if (!fibctx) return 0; /* Already gone */ - if((fibctx->type != FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT) || + if ((fibctx->type != FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT) || (fibctx->size != sizeof(struct aac_fib_context))) return -EINVAL; spin_lock_irqsave(&dev->fib_lock, flags); @@ -509,7 +509,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) srbcmd = (struct aac_srb*) fib_data(srbfib); memset(sg_list, 0, sizeof(sg_list)); /* cleanup may take issue */ - if(copy_from_user(&fibsize, &user_srb->count,sizeof(u32))){ + if (copy_from_user(&fibsize, &user_srb->count, sizeof(u32))) { dprintk((KERN_DEBUG"aacraid: Could not copy data size from user\n")); rcode = -EFAULT; goto free_sg_list; @@ -605,7 +605,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) } /* Does this really need to be GFP_DMA? */ p = kmalloc(upsg->sg[i].count,GFP_KERNEL|__GFP_DMA); - if(!p) { + if (!p) { dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", upsg->sg[i].count,i,upsg->count)); rcode = -ENOMEM; @@ -618,7 +618,9 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) sg_indx = i; if (flags & SRB_DataOut) { - if(copy_from_user(p,sg_user[i],upsg->sg[i].count)){ + if (copy_from_user(p, + sg_user[i], + upsg->sg[i].count)) { dprintk((KERN_DEBUG"aacraid: Could not copy sg data from user\n")); rcode = -EFAULT; goto free_user_srbcmd; @@ -657,7 +659,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) } /* Does this really need to be GFP_DMA? */ p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA); - if(!p) { + if (!p) { dprintk((KERN_DEBUG "aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", usg->sg[i].count,i,usg->count)); kfree(usg); @@ -669,7 +671,9 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) sg_indx = i; if (flags & SRB_DataOut) { - if(copy_from_user(p,sg_user[i],upsg->sg[i].count)){ + if (copy_from_user(p, + sg_user[i], + upsg->sg[i].count)) { kfree (usg); dprintk((KERN_DEBUG"aacraid: Could not copy sg data from user\n")); rcode = -EFAULT; @@ -710,7 +714,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) } /* Does this really need to be GFP_DMA? */ p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA); - if(!p) { + if (!p) { dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", usg->sg[i].count,i,usg->count)); rcode = -ENOMEM; @@ -723,7 +727,9 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) sg_indx = i; if (flags & SRB_DataOut) { - if(copy_from_user(p,sg_user[i],usg->sg[i].count)){ + if (copy_from_user(p, + sg_user[i], + usg->sg[i].count)) { dprintk((KERN_DEBUG"aacraid: Could not copy sg data from user\n")); rcode = -EFAULT; goto free_user_srbcmd; @@ -759,8 +765,9 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) sg_indx = i; if (flags & SRB_DataOut) { - if(copy_from_user(p, sg_user[i], - upsg->sg[i].count)) { + if (copy_from_user(p, + sg_user[i], + upsg->sg[i].count)) { dprintk((KERN_DEBUG"aacraid: Could not copy sg data from user\n")); rcode = -EFAULT; goto free_user_srbcmd; @@ -793,12 +800,12 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) } if (flags & SRB_DataIn) { - for(i = 0 ; i <= sg_indx; i++){ + for (i = 0 ; i <= sg_indx; i++) { byte_count = le32_to_cpu( (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64) ? ((struct sgmap64*)&srbcmd->sg)->sg[i].count : srbcmd->sg.sg[i].count); - if(copy_to_user(sg_user[i], sg_list[i], byte_count)){ + if (copy_to_user(sg_user[i], sg_list[i], byte_count)) { dprintk((KERN_DEBUG"aacraid: Could not copy sg data to user\n")); rcode = -EFAULT; goto free_user_srbcmd; @@ -808,7 +815,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) } reply = (struct aac_srb_reply *) fib_data(srbfib); - if(copy_to_user(user_reply,reply,sizeof(struct aac_srb_reply))){ + if (copy_to_user(user_reply, reply, sizeof(struct aac_srb_reply))) { dprintk((KERN_DEBUG"aacraid: Could not copy reply to user\n")); rcode = -EFAULT; }