From patchwork Sun Oct 16 14:19:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 3031 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1046263wrs; Sun, 16 Oct 2022 07:48:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62jNz2YSSvJpaZCL634vnjexevm2XCrETQ2W5q4FOcO/nRf1iGgw15WHtHh3vSMHUCkaLr X-Received: by 2002:a17:902:e88d:b0:185:3ac3:e1fd with SMTP id w13-20020a170902e88d00b001853ac3e1fdmr7410037plg.114.1665931708253; Sun, 16 Oct 2022 07:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665931708; cv=none; d=google.com; s=arc-20160816; b=m9Gebt7Jt6Wnx1KpVd2Sn10sA1P6W1Xybkl+gmwkWioMKYpQKhdtURmEJT52kaLnXO 8TRvGxzq98IpQogQ0/iC+wT3MNLDzk33ZMeSpqRY9y+yiKj4nSks7/3oz3E6QGZzJggu Cn0wNEOoKh4oB/2sDxN6ADYWgW7T55g6/CzWkRj/CdpoZQi9kUBSVC0uAwZdbLHynBxG cOh9QiDtJ7OlWg8ehU4ltYiriMurAhJnQmcEFLrB29iHEE8WkSmt3eUtr4IhVc3PiAXX bprgEXZT8D1wJ9s0EfQzHoEebaPSENSpBriWSONkDG5+eekprbes5LvvpoYebXzxqIfz d1ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=WO+k1977z0WvCv5GUpSkaOkuSb5Iv70KTYS+Dl4CO0o=; b=IDqsYxI1z/aqKsMC+VbQkcWro7XQiAgC8z5l8ja+j2vxT4c8YrZcIXLw6so8OaWxIL ao83HDwdm2bOtdOO8h78CC/DFdg4/+ScMf6dQ51MA1M1qr55o7BxLmQMCSXJOg/QNveE Xn3855vs8tZjEk17Bp7wcQ7ajrrlfLdJAATxP7clgnazFtAkMfbL5Te2zWI7MoSnQLYO s/PrbEyjVd6nLTRyPZb+I8xQ5T2yBdAQdG0VyGb/RSLIal9kTrXnfgw7MfDkWlIZfS/N C2843uJvJ6K9j+M6pPEA4ouebiC+HP+1tzYojqoLEozm2HVnZQzKXNgel0Gc0EFJK6bk 05mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Jr7gAm6M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a634104000000b0043a0510a99dsi8729089pga.515.2022.10.16.07.48.15; Sun, 16 Oct 2022 07:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Jr7gAm6M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229616AbiJPOkK (ORCPT + 99 others); Sun, 16 Oct 2022 10:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbiJPOkI (ORCPT ); Sun, 16 Oct 2022 10:40:08 -0400 X-Greylist: delayed 1221 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 16 Oct 2022 07:40:05 PDT Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 848D831376 for ; Sun, 16 Oct 2022 07:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1665929957; bh=eGiDjkHU2H18+UPJbCBnMLwPn0ooEAda11HpwCTW7NE=; h=X-EA-Auth:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type; b=Jr7gAm6Ms40j66UKi9lALGQDZMf4kYHTU3PElDk+o5p3llOSr+G5X5a+Ubi6+7Y2v wb0sLR1w7WpmjPJdZxHX2Ov+Wcpb8mgAcUK0BqGOaFe0mxx8coqzEgfLiLaQFFtyFI h7fFNPbqcSX5sDcs8XHR4BMkGSYnFvnSCFT9/RLM= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via [213.182.55.206] Sun, 16 Oct 2022 16:19:16 +0200 (CEST) X-EA-Auth: ZlYqw7q+n9bWm0E6M2C4cko2RDVMvIgADjfKHRVLOR30Cm/e+LuD7Xdw2nHPPvVfc+puoJzaiDklCQrDpRBLDd7molkJY2vr Date: Sun, 16 Oct 2022 10:19:12 -0400 From: Deepak R Varma To: outreachy@lists.linux.dev, pure.logic@nexus-software.ie, johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging: greybus: loopback: enclose macro statements in do-while loop Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746856007054423588?= X-GMAIL-MSGID: =?utf-8?q?1746856007054423588?= Include multiple statements of macro definition inside do-while{0} loop to avoid possible partial program execution. Issue reported by checkpatch script: ERROR: Macros with multiple statements should be enclosed in a do - while loop Signed-off-by: Deepak R Varma --- drivers/staging/greybus/loopback.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 1a61fce98056..37214cb43937 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -163,9 +163,11 @@ static ssize_t name##_avg_show(struct device *dev, \ static DEVICE_ATTR_RO(name##_avg) #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) + gb_loopback_ro_avg_attr(field); \ +} while (0) #define gb_loopback_attr(field, type) \ static ssize_t field##_show(struct device *dev, \