Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752425AbdGRLE2 (ORCPT ); Tue, 18 Jul 2017 07:04:28 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:32992 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019AbdGRLE0 (ORCPT ); Tue, 18 Jul 2017 07:04:26 -0400 Date: Tue, 18 Jul 2017 13:04:33 +0200 From: Johan Hovold To: karthik@techveda.org Cc: pure.logic@nexus-software.ie, johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, sunil.m@techveda.org Subject: Re: [PATCH] staging: greybus: loopback: Enclose multiple macro statements in do-while loop Message-ID: <20170718110433.GK29638@localhost> References: <1500375400-9617-1-git-send-email-karthik@techveda.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1500375400-9617-1-git-send-email-karthik@techveda.org> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 797 Lines: 23 On Tue, Jul 18, 2017 at 04:26:40PM +0530, karthik@techveda.org wrote: > From: Karthik Tummala > > Enclosed multiple macro statements in a do - while loop as per kernel > coding standard, pointed by checkpatch. \ > static DEVICE_ATTR_RO(name##_avg) > > -#define gb_loopback_stats_attrs(field) \ > - gb_loopback_ro_stats_attr(field, min, u); \ > - gb_loopback_ro_stats_attr(field, max, u); \ > - gb_loopback_ro_avg_attr(field) > +#define gb_loopback_stats_attrs(field) \ > +do { \ > + gb_loopback_ro_stats_attr(field, min, u); \ > + gb_loopback_ro_stats_attr(field, max, u); \ > + gb_loopback_ro_avg_attr(field); \ > +} while (0) You obviously did not even compile-test this before submitting it, which needless to say, is not ok. Johan