Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: kernel test robot <lkp@intel.com>,
	Nikunj A Dadhania <nikunj@amd.com>,
	llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [tip:x86/urgent 1/1] arch/x86/coco/sev/core.c:2170:30: warning: variable 'dummy' set but not used
Date: Tue, 1 Jul 2025 08:06:44 -0700	[thread overview]
Message-ID: <20250701150644.GA3563357@ax162> (raw)
In-Reply-To: <20250630192726.GBaGLlHl84xIopx4Pt@fat_crate.local>

On Mon, Jun 30, 2025 at 09:27:26PM +0200, Borislav Petkov wrote:
> On Tue, Jul 01, 2025 at 02:43:31AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/urgent
> > head:   4a35d2b5254af89595fd90dae9ee0c8f990a148d
> > commit: 4a35d2b5254af89595fd90dae9ee0c8f990a148d [1/1] x86/sev: Use TSC_FACTOR for Secure TSC frequency calculation
> > config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250701/202507010218.3O5Ge0Xt-lkp@intel.com/config)
> > compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
> 
> Pff, doesn't fire with clang-19.
> 
> That damn compiler.
> 
> gcc used to complain about those but they fixed their interprocedural analysis
> or whatnot.
> 
> clang is simply complaining more.

Citation needed. This reproduces with Clang 15 (earliest supported on
x86 now), Clang 19, and GCC 15 for me. Were you missing W=1?

  $ x86_64-linux-gcc --version | head -1
  x86_64-linux-gcc (GCC) 15.1.0

  $ curl -LSso .config https://download.01.org/0day-ci/archive/20250701/202507010218.3O5Ge0Xt-lkp@intel.com/config

  $ make -skj"$(nproc)" ARCH=x86_64 CROSS_COMPILE=x86_64-linux- W=1 olddefconfig arch/x86/coco/sev/core.o
  arch/x86/coco/sev/core.c: In function 'snp_secure_tsc_init':
  arch/x86/coco/sev/core.c:2170:37: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
   2170 |         unsigned long tsc_freq_mhz, dummy;
        |                                     ^~~~~

Cheers,
Nathan

  reply	other threads:[~2025-07-01 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 18:43 [tip:x86/urgent 1/1] arch/x86/coco/sev/core.c:2170:30: warning: variable 'dummy' set but not used kernel test robot
2025-06-30 19:27 ` Borislav Petkov
2025-07-01 15:06   ` Nathan Chancellor [this message]
2025-07-01 15:29     ` Borislav Petkov
2025-07-02 21:02       ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250701150644.GA3563357@ax162 \
    --to=nathan@kernel.org \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=nikunj@amd.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox