Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4113824rwb; Mon, 31 Jul 2023 01:16:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlFbopYu0Z1j3ZtyjLgqr7eHafFXYvWfErCgPC9BZNmY/wmhrGdnyzQfMoGQkw+545NyVycF X-Received: by 2002:a17:90b:38c6:b0:268:8da4:72ac with SMTP id nn6-20020a17090b38c600b002688da472acmr6797242pjb.22.1690791363967; Mon, 31 Jul 2023 01:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690791363; cv=none; d=google.com; s=arc-20160816; b=iUvH8SHFiX1LSCTRvn/P1XCCWnkd+J9Yg3D4x0Edoq+Py254UC1J9Y/vKLvPnsc6KB ElK2nMiYvh29ulU1icEedeDXtVS8zg2qU6T5iYN/N4qQjb51MS+SxAtQcyJ5oGzZnoNX 1oaeXTkV1iGEfL8Zzt9vJ8gOiIvdHntJxKf9gG/1hePJ/PQ0JYbgNk/QJGok10up4xtA YsqVVJhT5eoXHv/GwyPGafF/m5Ei1KktibJX/H5ZcAxnTWn3LiI7l2o0+usijpIsMzHT EcfW/blGzzgyHJfZW6Yyz/oqlwEyIbnzM1KqqPwxK92B29LMyHqUJD52qu7UERuLA7SS 8Jtw== 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=qMDMpT3FQqCFSU+kU3627mRkRbjsQe6cxDgwKGQyXms=; fh=xRdaOVXaRGrwW+9cTzkYYWmW/o9rqCRdnarYV03e28c=; b=aSEOL3XLDvn7YoA3EGd7uiaheNcohZDCPqVRnX2IRCaGz1ZLnd1CeWUygOo35UYvKz BZWFN2O9lsasQNR8SQf5ijXQNr7EpefHYI1d08uR2UuJxEaSn7TeK6mNjtDT7h9Xmk9S ToQFpAugEoNYgNUXYSubyhOsm50BumW+HH0/uBt6CLD2Hply8rWDCXObpfaIfxpDAT5f iTPHqo/iriPnhw6STl/E1XyPpOOYj4qMHqeOrrDY/bnW5jo0Omy0ztTIILerzazbXCup MEKfGIHzqcmypz0TWYrymdzJPw8WGo1Kj05LEtmmRuqleaRncZkL34T4/szlKyWmf4Su nPBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=X0FqEYXb; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a17090a948c00b002682dc64492si7021281pjo.185.2023.07.31.01.15.51; Mon, 31 Jul 2023 01:16:03 -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=@weissschuh.net header.s=mail header.b=X0FqEYXb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbjGaHKp (ORCPT + 99 others); Mon, 31 Jul 2023 03:10:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230474AbjGaHKF (ORCPT ); Mon, 31 Jul 2023 03:10:05 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCC851705; Mon, 31 Jul 2023 00:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1690787296; bh=q0/RMbeUsJRr/8U7rBQr1RX1EBgUx1jztSSJWUG/bOI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X0FqEYXbuvzgRsmhAkZyTtlI8dK/tAlt4VDJmHEoz9E2dpUcdD335TpxL9bjogV0Y bJJO30dWC+I2WTuIqEpYi80yZJ5I1lagZnBFFfkhluq7P3dmbhBaNUMyobxZ3OUQo2 h9IaB47Ip7Mdv+Y8a+fLrGvtAmRajbJyHw3Z9Bq0= Date: Mon, 31 Jul 2023 09:08:15 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Zhangjin Wu Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, tanyuan@tinylab.org, w@1wt.eu Subject: Re: [PATCH 1/4] selftests/nolibc: drop unused test helpers Message-ID: <7d8dee88-16af-464f-b7f3-55b77dbc3c46@t-8ch.de> References: <20230731-nolibc-warnings-v1-1-74973d2a52d7@weissschuh.net> <20230731064826.16584-1-falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230731064826.16584-1-falcon@tinylab.org> 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, T_SCC_BODY_TEXT_LINE 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 Note: It seems your mail client does not add the prefix "Re: " to responses. Is that intentional? On 2023-07-31 14:48:26+0800, Zhangjin Wu wrote: > Hi, Thomas > > > As we want to enable compiler warnings in the future these would be > > reported as unused functions. > > > > If we need them in the future they are easy to recreate from their still > > existing siblings. > > > > Signed-off-by: Thomas Weißschuh > > --- > > tools/testing/selftests/nolibc/nolibc-test.c | 99 ---------------------------- > > 1 file changed, 99 deletions(-) > > > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c > > index 03b1d30f5507..53e2d448eded 100644 > > --- a/tools/testing/selftests/nolibc/nolibc-test.c > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > > @@ -161,31 +161,6 @@ static void result(int llen, enum RESULT r) > > * of failures, thus either 0 or 1. > > */ > > > > -#define EXPECT_ZR(cond, expr) \ > > - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_zr(expr, llen); } while (0) > > - > > -static int expect_zr(int expr, int llen) > > -{ > > Why not a simple 'static __attribute__((unused))' line, then, no need to > add them again next time. > > -static int expect_zr(int expr, int llen) > +static __attribute__((unused)) > +int expect_zr(int expr, int llen) > { Personally I don't like having dead code lying around that needs to be maintained and skipped over while reading. It's not a given that we will need those helpers in the future at all. Thomas > > Thanks, > Zhangjin > > > - int ret = !(expr == 0); > > - > > - llen += printf(" = %d ", expr); > > - result(llen, ret ? FAIL : OK); > > - return ret; > > -} > > - > > - > > -#define EXPECT_NZ(cond, expr, val) \ > > - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_nz(expr, llen; } while (0) > > - > > -static int expect_nz(int expr, int llen) > > -{ > > - int ret = !(expr != 0); > > - > > - llen += printf(" = %d ", expr); > > - result(llen, ret ? FAIL : OK); > > - return ret; > > -} > > - > > [...] > > -- > > 2.41.0 > > > >