Clang build fixes for 7.1

- Wrap declaration and assignment of key_pass in certs/extract-cert.c
   with '#ifdef' that matches its only usage to clear up an instance of a
   new clang subwarning, -Wunused-but-set-global.
 
 Signed-off-by: Nathan Chancellor <nathan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHQEABYKAB0WIQR74yXHMTGczQHYypIdayaRccAalgUCaeqyXQAKCRAdayaRccAa
 lqyLAPii84oJfPxFyg5zhGeqZXz9EPvbZMvYvcz2vrdJ8V/rAQDlADj5PYW+F/S/
 n6AKTUThwun++MfL70pcN5EUXnkuBQ==
 =baKt
 -----END PGP SIGNATURE-----

Merge tag 'clang-fixes-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux

Pull Clang build fix from Nathan Chancellor:

 - Wrap declaration and assignment of key_pass in certs/extract-cert.c
   with '#ifdef' that matches its only usage to clear up an instance of
   a new clang subwarning, -Wunused-but-set-global.

* tag 'clang-fixes-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux:
  extract-cert: Wrap key_pass with '#ifdef USE_PKCS11_ENGINE'
This commit is contained in:
Linus Torvalds 2026-04-24 09:29:51 -07:00
commit bbc4af7ad9

View File

@ -41,7 +41,9 @@ void format(void)
exit(2);
}
#ifdef USE_PKCS11_ENGINE
static const char *key_pass;
#endif
static BIO *wb;
static char *cert_dst;
static bool verbose;
@ -133,7 +135,9 @@ int main(int argc, char **argv)
if (verbose_env && strchr(verbose_env, '1'))
verbose = true;
key_pass = getenv("KBUILD_SIGN_PIN");
#ifdef USE_PKCS11_ENGINE
key_pass = getenv("KBUILD_SIGN_PIN");
#endif
if (argc != 3)
format();