Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753154AbbLKNCq (ORCPT ); Fri, 11 Dec 2015 08:02:46 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:19901 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbbLKNCo (ORCPT ); Fri, 11 Dec 2015 08:02:44 -0500 Date: Fri, 11 Dec 2015 16:02:33 +0300 From: Dan Carpenter To: Sanidhya Solanki Cc: lidza.louina@gmail.com, markh@compro.net, gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes Message-ID: <20151211130233.GJ5284@mwanda> References: <20151211032149.489d90d1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151211032149.489d90d1@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1382 Lines: 45 On Fri, Dec 11, 2015 at 03:21:49AM -0500, Sanidhya Solanki wrote: > >From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001 > From: Sanidhya Solanki > Date: Fri, 11 Dec 2015 03:08:53 -0500 > Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes Don't include this stuff. > > Patch contains the checkpatch fixes as asked by the TODO. > TODO file is updated as well. Fix one type of warning at a time. This will be a series of patches. > > Signed-off-by: Sanidhya Solanki > @@ -110,7 +98,16 @@ static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, > int count = 0; > int i = 0; > > - DGNC_VERIFY_BOARD(p, bd); > + do { > + if (!p) > + return 0; > + > + bd = dev_get_drvdata(p); > + if (!bd || bd->magic != DGNC_BOARD_MAGIC) > + return 0; > + if (bd->state != BOARD_READY) > + return 0; > + } while (0); Google about why do while(0) loops are used in macros and then redo this. Mostly the patch isn't bad, but I suspect I'm going to complain about how you split up some of the long lines. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/