Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbbLKOMP (ORCPT ); Fri, 11 Dec 2015 09:12:15 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:33139 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbbLKOMO (ORCPT ); Fri, 11 Dec 2015 09:12:14 -0500 Date: Fri, 11 Dec 2015 05:10:43 -0500 From: Sanidhya Solanki To: Dan Carpenter 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: <20151211051043.4f7d24df@gmail.com> In-Reply-To: <20151211130233.GJ5284@mwanda> References: <20151211032149.489d90d1@gmail.com> <20151211130233.GJ5284@mwanda> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1367 Lines: 32 On Fri, 11 Dec 2015 16:02:33 +0300 Dan Carpenter wrote: > > 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. Let me just be completely sure that you and I are on the same page here. The macro was used to replace the do-while loop, I replaced all instances of the macro with the the actual loop. Both pieces were originally part of the code, just using macros in place of do-while statements. Do you still want me to change it? Maybe the original author did it for a specific reason. Thanks -- 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/