Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2582150lqz; Wed, 3 Apr 2024 02:25:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+7Th3xzhz2BBuk58POveagLwrf6RVHp7524vHeoDzuJylyZzxH8UtCLIqu87NhYp/tloVqUjWnnFEReoNB/30Iz9ViMH7bznqD00KFQ== X-Google-Smtp-Source: AGHT+IGRbsFf4tXG6tp1xMZ3LocX1iYzj0BvQyCE7VqLIG/m69vvbnyimTYf4Lfn6TPPzAIHQVOa X-Received: by 2002:a05:6a20:7354:b0:1a7:23ae:92c3 with SMTP id v20-20020a056a20735400b001a723ae92c3mr4264383pzc.12.1712136342778; Wed, 03 Apr 2024 02:25:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712136342; cv=pass; d=google.com; s=arc-20160816; b=eH++nKAcw3UdHKAR6qIWVeZAAxlIakesX3zI6SzfGcdfeEgw/wA5OdWUoeQzhm7icd NTgEE+a3wLj7uaPGrwOeje87D3TvLdxE1TyBA8SUJJlNQRBj9hkeHhtzEYgdna9tSsak tGJIi/PYI0AKPGKcy7YJoFxdvZWTXMJRyE1wjTLRTL2lzbJAQtP9ipuuF6a7r2Xsdv4P WfGVtVAaP/DQpYEvgVhmAFNwVifhIDg/30cbw5wVUjrd7RP8FwDGOwML3GDSFIeGsb9n 7QjDTQmHaoSJyMDx9crGqDxmcglfGzV313RFeZxRIOqubYz6GrdqJnjYWe1YFbNAvIr6 353g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=gGCGGpz42+ijw45uO6Rv6ds+pPypoT31rsDVQN08Em4=; fh=5FaYWLnBcdHfxHqzApeDHOE5qkjSp1SBrgZS5GV5Jvs=; b=eZVrFdy6a2Q7TNS3WJsT9jXi3RsGlYKzN4mj9mm84WpacbaRyq25jACd96tL2jMoNv Gs0DdeyFm9P3vteateC4fURlZQ2bCJ9JfTRFWAIhbXpo8v4A2VU9ZCLYhG0otXBn9kEj hqN5APm9sHr/Wre4sJwFLaKqbbdfmIUML78psUonjWIrvCLB9SSpht8VB7tgLapR8qI+ zRq68r+Opg5hDf7GAidaZbBnpARBLRd+xNEIEtm12XpZH4Q/zk9Dqj3kmt0e0tVgIGrP s0JDlJwN9exu6oJZN3esyBQTYZuq6s2eBRg3drQQY3xxQp6KAQb+Awn12S21QFB6AlQY yjLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=DutANyus; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=ZcKXuE5i; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-129377-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129377-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j11-20020aa783cb000000b006ead086ea6bsi12513046pfn.87.2024.04.03.02.25.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 02:25:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129377-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=DutANyus; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=ZcKXuE5i; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-129377-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129377-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 080A8B27C7A for ; Wed, 3 Apr 2024 08:58:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4845D6EB79; Wed, 3 Apr 2024 08:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="DutANyus"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZcKXuE5i" Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE8C46E2BE for ; Wed, 3 Apr 2024 08:58:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712134704; cv=none; b=TxAXypwtW8WKteDd6ATaROysSXGouuXGcEOVlv7svEJ3gyvkUH8SMc0Yk53Ihk0yIzXvGCYuIDBr157/4chi47YTaXoSLcZ9LEfZxnTG0aAwzIatEiOTEuyll6nYxJ1jOz6QUT7h65/t1l8xICbgijLns8gSemj2+FOFZDH+7LQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712134704; c=relaxed/simple; bh=WfmsbRUW97Ckf20AJKx4XzGD3PzrHVAJfU97EobaptE=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=E3BH3F6rM33pFnv/YGYXxA3V906Kwn/UCfW4ozIOg/SEDXvrUG9xBT3KmWINdKrxkmfsHBSK7RdRlzo4jwCoMA6Uao9ibD9mdGwIMkRxMjKF9d2VE/LLt3wdPaaDThdKPpbt3fyp+4Y0E2y4jgrIh5uanzAbu+KEQr+xym9ZJ2M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=DutANyus; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ZcKXuE5i; arc=none smtp.client-ip=103.168.172.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id E1B3113800FB; Wed, 3 Apr 2024 04:58:21 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Wed, 03 Apr 2024 04:58:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1712134701; x=1712221101; bh=gGCGGpz42+ijw45uO6Rv6ds+pPypoT31rsDVQN08Em4=; b= DutANyushqcHwQUgotcWxzGKLfWFFGo5DWC+nZ77BzdwhfT4HhHblcn2J0WIQEQK 1Dy/DsmI0PtrqSNFPeER6e+6F3B9H9y+7YeAG2YkfTXvtCXu8hEb21yn1esUnqP/ tK0Payp8fVvcKg8SGERZFzCc6oEFW1WntCvWCfPziRzvv6JT31Yum25X7dFx7xL2 Ot+0wk92/mLDAJS1zO9c8O3s5wmHKmKW8oCUiPMkZ49jKTSAponTBepkB8NJwQsv mhlj5GTk2x+lxifpG8fIbUqrWZVGq6W/2NdBDSkunHm8SnnTlKKRs57mp3pL9GgZ 3jJQ77xhrM+Y/lsXSUH3Nw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712134701; x= 1712221101; bh=gGCGGpz42+ijw45uO6Rv6ds+pPypoT31rsDVQN08Em4=; b=Z cKXuE5ipL1LluEOml4Q5akRLLRewHdL4lBEFc5NMHwPO2M9/FMaS4jPxtZTsOZKj wRHuRxUJ2vp/THeVGif1g59uvmk9TbwXGc+zJz6vahWKnUN9iDtvNF+K1RAIF2hC sUSEvHcp+KsYIQvkmVDD16rlx/Ecrd+bPrys+OWLylKCubk+sNaIkH3Xh4ZHFzZz m/XpJ56+J1lhFjeOR5MVFbay6SofM46IOAfpdgZaoPaKrofEdScmdlq1o7MBgaAn sXm9YJYs/h1kF2v8d0A8NexqYCxjYpTLI8MBwEP9u4r9sbbde+ktEoYttwmiIj8K fDOd2WJs909lH7vQ4HAww== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefgedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpefgkeeuleegieeghfduudeltdekfeffjeeuleehleefudettddtgfevueef feeigeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 58C76B6008D; Wed, 3 Apr 2024 04:58:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-333-gbfea15422e-fm-20240327.001-gbfea1542 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: <66a1d5f1-d9b2-402c-826d-955370288037@csgroup.eu> References: <20240403080702.3509288-1-arnd@kernel.org> <20240403080702.3509288-19-arnd@kernel.org> <66a1d5f1-d9b2-402c-826d-955370288037@csgroup.eu> Date: Wed, 03 Apr 2024 10:58:00 +0200 From: "Arnd Bergmann" To: "Christophe Leroy" , "Arnd Bergmann" , "linux-kernel@vger.kernel.org" , "Andrew Morton" , "Palmer Dabbelt" Cc: "Dave Hansen" , "Noah Goldstein" , "Charlie Jenkins" Subject: Re: [PATCH 18/34] lib: checksum: hide unused expected_csum_ipv6_magic[] Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Apr 3, 2024, at 10:41, Christophe Leroy wrote: > Le 03/04/2024 =C3=A0 10:06, Arnd Bergmann a =C3=A9crit=C2=A0: >> From: Arnd Bergmann >>=20 >> When CONFIG_NET is disabled, an extra warning shows up for this >> unused variable: >>=20 >> lib/checksum_kunit.c:218:18: error: 'expected_csum_ipv6_magic' define= d but not used [-Werror=3Dunused-const-variable=3D] >>=20 >> Hide it under the same #ifdef as the reference to it. >>=20 >> Fixes: f24a70106dc1 ("lib: checksum: Fix build with CONFIG_NET=3Dn") > > I think that commit introduced unjustified #ifdef in a C file. > Refer=20 > https://docs.kernel.org/process/coding-style.html#conditional-compilat= ion > > The fix should be: > > + if (!IS_ENABLED(CONFIG_NET)) > + return; > + > for (int i =3D 0; i < NUM_IPv6_TESTS; i++) { > saddr =3D (const struct in6_addr *)(random_buf + i); > daddr =3D (const struct in6_addr *)(random_buf + i + > @@ -618,7 +620,6 @@ static void test_csum_ipv6_magic(struct kunit *tes= t) > CHECK_EQ(to_sum16(expected_csum_ipv6_magic[i]), > csum_ipv6_magic(saddr, daddr, len, proto, csum)); > } > -#endif /* !CONFIG_NET */ Yes, I usually prefer that approach, and I think I tried it first but ran into compile-time problems because csum_ipv6_magic() is declared conditionally. Let me try again, maybe I misremember what I did or I can remove some more #ifdef checks for this. Arnd