Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp118095lqi; Wed, 6 Mar 2024 11:40:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVYyjI4kEx9N9FWMAs9UWYiHBWq+I7WCHNAO3AnU3wmh0yyUJmWNoLYD7mdooF4xbNwxdncXguLBdPpkqIVnVKxvbSE1ZxD8lNKzEaP7Q== X-Google-Smtp-Source: AGHT+IFHQm6u8e745TOp07MzMwBgazTvie8b3JjbOH1+1zLf6T7/7PH0LD99AWlIZMkawuSq3JEE X-Received: by 2002:a17:906:7118:b0:a45:5bc1:ac35 with SMTP id x24-20020a170906711800b00a455bc1ac35mr5586255ejj.30.1709754044564; Wed, 06 Mar 2024 11:40:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709754044; cv=pass; d=google.com; s=arc-20160816; b=SdtS5dceAcQ0WKe5d6E2NcMi7PtpHHNWitCqzC4rEEnaQYlNmTL/w54eL6XDlgo0yQ nC8b08jQt92IJio8XT6Bzwtc/RWN4wUhlM53gUvWw5gOeYV6vWMJub4VfO93wss8DQuf u+gw1sMSfABg71B+4Jfxvs4GkcpQajnrFc0R8nhCbnBlq1301N2o+FWwGBPSuY0C+UwZ vuhCsa48S2kda4irxp91SS0wQfixiU6/0gGggextsMfCkRbmbIkl5ryRYPxZ6C5L7shz 0eSC9JfbOPzJS875jzhJ6Yr5lp2iNRW1cgEPfcKmkjNuua2FOJO2JzElUT9XPulLDP/a zjpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aJQbdgZKjt3hC5Lxf1ZMX53czAKc6KU0YHiAPB7jJT8=; fh=zlbigfGqelFcL6vZ92zFWky3yEyBqsEeoWH/YbUrSec=; b=nAAu+RCjV+356CAOanBdZRb5uYpLrTCqASrkMa3FscHv3fgf4I1sZmMw5aGM/RFcP1 700bDwNqJ8BfvA6jxykJPz7RGfyTrq8C11fTbDMu1bEjkbkV3BWC13X4Fcf+Wzw029Fp HnIYCqjqbs873WxvIV04XsudZWvASChK3QSWrTW7vBQAIfrJEqW/xsEBT5yGMsQ1I6k/ 8DtuxoXcCdJ6dhfjK29oeHfjFrJgpOvQnu8SWzVo7oTEvDaBhjVrglR2g0wsy6x9fgDh OKhQhQ9PYPL3mP28MJZ9P6GK5cxxXP6D5dRw6Uy4/x+mbHcPLH55Nx8xYLh06D9G1zL/ iPLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JKLC432o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-94492-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94492-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id uz28-20020a170907119c00b00a437f113ce9si6416710ejb.779.2024.03.06.11.40.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 11:40:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94492-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JKLC432o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-94492-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94492-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4F0021F24B75 for ; Wed, 6 Mar 2024 19:40:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B57D140E50; Wed, 6 Mar 2024 19:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JKLC432o" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 77190140E25 for ; Wed, 6 Mar 2024 19:40:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709754024; cv=none; b=BQDcV9DT9GxOJaSZjA5w3HnfyMcpqQJTP/mSoJ5PUDr+zlD9/nWRnFAOho4GUtNKkFjeKKN7ptQVQo36LBIYC+8e2zXk++MZd6pzVw73qeHb3FpHW0/yUO+oECbTgh99HmDyAKBF0Ye08Ed+uz1SIXlqiKzVjxuUpPqrk7Bfmb4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709754024; c=relaxed/simple; bh=5/Zn7NHW1uTwkwELhBiHm6Z/dCQjigrm4gBqAaJY9Ho=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hTsmbn2mQah4Vi/fEtq0oshQkKccP5khswCqvnx8S4dgvfYC9TE5m1B2IHuCwqOa22Aaax4yNw2B4w2tf+CMAlD54lvD0frFxgEQpSgkOqRR0kAC8cuddyQAhUH1uLZqLq5DvesCiDfsyfbCPeXuM1rmyXs180SxmSvmRfST1Ew= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JKLC432o; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15D6C433C7; Wed, 6 Mar 2024 19:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709754023; bh=5/Zn7NHW1uTwkwELhBiHm6Z/dCQjigrm4gBqAaJY9Ho=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JKLC432oMy/qlvpf9vVwvVrMXSu9agkHKeeO3zV41CO6dZ20Sm+V1eNXj22cNLo5Z G+5sWuR3L6AmhazuPitHyEI9Q62kI8Foz0g935QQYo5vAzrjZ8nDxoXm0R/Wr/9CFG vPXG+0e+XKAtpxEOR49vSMOYzsg0x7aSvwcfzAYphXrOpC1eDjwtgQjdyTDVvoqQSC SuqdIW6aNwut2F9YETPd7sXXRv9mmM45omYm/5wkTilQZD9GK9SEX1YNN/R2vmh6sP W8ymyxZAaL1dbgbc4v+T12pja5MoSTS/EQylltQZ+i5r84F3qO2rQpqaPUmf0jdR02 kkHwk+XGSsg9Q== Date: Wed, 6 Mar 2024 12:40:20 -0700 From: Nathan Chancellor To: Chunhui Li Cc: Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky , Matthias Brugger , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com Subject: Re: [PATCH] printk: fix _entry_ptr build warning Message-ID: <20240306194020.GA3711543@dev-arch.thelio-3990X> References: <20240306092647.16010-1-chunhui.li@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240306092647.16010-1-chunhui.li@mediatek.com> On Wed, Mar 06, 2024 at 05:26:47PM +0800, Chunhui Li wrote: > We build with Werror and suffer build error when > enable CONFIG_PRINTK_INDEX, such as > gfp.h:223:2: error: unused variable '_entry_ptr' > ratelimit.h:31:3: error: unused variable '_entry_ptr' > kallsyms.h:172:2: error: unused variable '_entry_ptr' > [-Werror,-Wunused-variable] > > Fix the warning by appending __attribute__((unused)). > > Signed-off-by: Chunhui Li Are these warnings being emitted from an Android version of clang, specifically 18.0.0 with the build ID of 11209041 (you should be able to tell this from the "bid" field in the BUILD_INFO file in the clang toolchain folder)? This seems remarkably similar to https://github.com/ClangBuiltLinux/linux/issues/1977, which was a report using that version of Android clang. Ultimately, this warning is a bug in a clang change that was quickly found and reverted upstream https://github.com/llvm/llvm-project/commit/f0f395e00e2ec3f1f20ca9021d1554fde73d56c9 https://github.com/llvm/llvm-project/commit/cfa578cde0314935c6eb5d7fa19ec26390d431dd but unfortunately, Android picked a revision for the 11209041 build that was between the landing of the broken commit and its revert. It was quickly fixed with the 11368308 build https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/42d100b025eb5f4a41781348016c148e9e912cf9 so you should just be able to update to that version to resolve this. Cheers, Nathan > --- > include/linux/printk.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/printk.h b/include/linux/printk.h > index 8ef499ab3c1e..749c1c4257f1 100644 > --- a/include/linux/printk.h > +++ b/include/linux/printk.h > @@ -392,7 +392,7 @@ struct pi_entry { > .level = __builtin_constant_p(_level) ? (_level) : NULL, \ > .subsys_fmt_prefix = _subsys_fmt_prefix,\ > }; \ > - static const struct pi_entry *_entry_ptr \ > + static const struct pi_entry *_entry_ptr __attribute__((unused)) \ > __used __section(".printk_index") = &_entry; \ > } \ > } while (0) > -- > 2.18.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel