Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4116365rwl; Sun, 2 Apr 2023 23:25:21 -0700 (PDT) X-Google-Smtp-Source: AKy350Yueq1l5irVa+5kLq3gF7yHTIjmeCozZq94vrRjwPBsImhn9h5DmNTK5no4vmjvT/86Ki6D X-Received: by 2002:a17:90a:35c:b0:237:401c:9bd5 with SMTP id 28-20020a17090a035c00b00237401c9bd5mr38226949pjf.46.1680503121707; Sun, 02 Apr 2023 23:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680503121; cv=none; d=google.com; s=arc-20160816; b=v3U6IS+Ejq5ViG/x5ZTHFGEnGXvN6lumRlsfoWhNZWvgMoJ6BmK43ww8nM5IuPXtfF 39mcFh/jldY9BfBLZ6OYWEGWQDRBiG5I1CtxUHRWkrLc1PUQ3tXrBcXE9u8dBqNG2CT3 68VYnkNX+qfcnDhb9R1bGebwtXZOcePYirI+BcY9KliOdxrCCRNHPgyyOIEZZjtTLT56 cfp+9KWWqKa9OPMAYMFs9jWGFx/6QH4mvxqVXGyeoWGbbYBjar4tCj4cFSpEIMKTCASe 6enAGBA4v4kulXnxMvXZYFERWZaNZ9jUKH1alMIAimMkOsdVR/fF4eG4DfuyaF4p4KYK 98Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ElJuNUFsMwi5roY3yyQjQy4Z7CYKWDGQhJKFQymJzes=; b=fr62bVOCgof/uVCu5vtcGorRzz0/aZGqrrqeNcxX+iGlCZPDP3Y0O1Wi/Og3hIwKUO XgdoKMs8+lL+0gsxh9fA/9CeNpnYACIL/+xFdvyS1YoQzkeA8hm8rToxd4G10HfCy4f2 khYB49pphNIjfJwq6My5G9YsSDoks2Ulh6LpK+cQGdEAMlSjvBvY9a8qXsU1feZz9/da 6FHfUxrpmLds5tAJmuOohzc/0tVnqQAbb4JeqF8igFA28GU9VJIIznpJquSyXt1wgvwC NodRgDg1e35aLE5Cl3OQV75ZDUj1UMaa7vboJRep8B7+FTaf7ePcwfjjhV2JIeGamxY8 mkTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Gut8oqvT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q3-20020a170902dac300b0019e3ff8c342si7861495plx.595.2023.04.02.23.25.10; Sun, 02 Apr 2023 23:25:21 -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=pass header.i=@gmail.com header.s=20210112 header.b=Gut8oqvT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231549AbjDCGYK (ORCPT + 99 others); Mon, 3 Apr 2023 02:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231526AbjDCGYH (ORCPT ); Mon, 3 Apr 2023 02:24:07 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0EBCA273 for ; Sun, 2 Apr 2023 23:24:01 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id cn12so112839119edb.4 for ; Sun, 02 Apr 2023 23:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680503040; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ElJuNUFsMwi5roY3yyQjQy4Z7CYKWDGQhJKFQymJzes=; b=Gut8oqvT/qTTCSw9tafkiGG4ANcTSTe9WKKbcS+OIQeFNEzv8PEkAGACUDo0vLkSvO mpoWxf0S+uPbwz+gIh7GBgNPKDLW0Jj5b7ej3mdCraL//CWZEiizZq+s6WIWFSw/qzbB Cqq289fNXw2UwlUKqZvX1KSpVVN1ork23LdwzrdjAjjFMCO4OvgFNp9PZzEUwLe8gmTr L+opyiHomo4VNaNBddzAwcpHpNnkQBbahQ7USHr3/0HuJMrmW7NJqFGtygOUSIiwSsTA UeK3D2TTjYrIflxoiaGQ0y/Ughn1Twnau3pJDmVcDP6CdQYNA6Uhg9gv5qWgtAox8NYi q5Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680503040; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ElJuNUFsMwi5roY3yyQjQy4Z7CYKWDGQhJKFQymJzes=; b=EzYQrQ9s6dlZoKZHPiuup6JOWnEeNH968ralzJRhM474P6opXKEvGhHfoFFWDOX979 mBFBxhRPinrPAz6JQrbX9vcNgECEYm91vpQU6jhIPklPTpOnpzDAD0CbKmjPhq52wQB3 ZW47wcWJEzvhoh09xzxccNx1akXm/b6m2o9oWIe2mROoaV9TvGy60KFw0tfh9NjLqtDQ juRo5Ldoe1MvYUpPENkVmzib4AMEG63w/+Tk7/cZqWbrSqSlwXJ4u/OCGoXNTV7Bcg2w uKeqsqX0bZGUD+8EpP8XBFhAMYhnJcDt7fsHwZt8J730Y8wFnyDlPSvClutYkCcPlbEr R0Hw== X-Gm-Message-State: AAQBX9c8i49KVqKk3sEK5TD+MHpzamu9n+0PyzKTqyckgBy/6Cw8949U cJ5/jyjPi3OoP34c4V8gCWk= X-Received: by 2002:a17:906:7f1a:b0:8b1:29ed:e206 with SMTP id d26-20020a1709067f1a00b008b129ede206mr30080061ejr.28.1680503040092; Sun, 02 Apr 2023 23:24:00 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id a26-20020a50c31a000000b005027686918bsm3955881edb.11.2023.04.02.23.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 23:23:59 -0700 (PDT) Date: Mon, 3 Apr 2023 09:23:55 +0300 From: Dan Carpenter To: =?iso-8859-1?Q?=C1ngel?= Alberto Carretero Cc: Greg Kroah-Hartman , Bryan O'Donoghue , Johan Hovold , Alex Elder , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: greybus: loopback: fix up checkpath macro do while error. Message-ID: <2cb170e2-3551-4f2a-9cd3-065d9bd4504b@kili.mountain> References: <20230402122550.70682-1-angelalbertoc.r@gmail.com> <2023040252-racoon-daintily-3589@gregkh> <0af15115-9641-a1c8-f398-c4e8e77379a3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0af15115-9641-a1c8-f398-c4e8e77379a3@gmail.com> X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Sun, Apr 02, 2023 at 08:22:35PM +0200, ?ngel Alberto Carretero wrote: > > > On 02/04/2023 15:16, Greg Kroah-Hartman wrote: > > On Sun, Apr 02, 2023 at 02:25:51PM +0200, Angel Alberto Carretero wrote: > > > Wrap macro in a do-while statement. > > > > > > Signed-off-by: Angel Alberto Carretero > > > --- > > > drivers/staging/greybus/loopback.c | 8 +++++--- > > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c > > > index d7b39f3bb652..371809770ed0 100644 > > > --- a/drivers/staging/greybus/loopback.c > > > +++ b/drivers/staging/greybus/loopback.c > > > @@ -162,9 +162,11 @@ static ssize_t name##_avg_show(struct device *dev, \ > > > 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) > > > + 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) > > > #define gb_loopback_attr(field, type) \ > > > static ssize_t field##_show(struct device *dev, \ > > > -- > > > 2.40.0 > > > > > > > > > > Any specific reason why you did not test build your change before > > submitting it? > > > > thanks, > > > > greg k-h > > Apologies, we can drop the patch. I was trying to find an error as part > of the eudyptula challenge and thought I was compiling the driver > correctly. Upon further examination, the macro cannot be written with a > do-while because it is defining functions. The "eudyptula challenge" and other first patch guides should be updated to tell people to search for their code on lore.kernel.org before sending a patch. See if you can fix one of the howtos. regards, dan carpenter