All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	George Abraham P <george.abraham.p@intel.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: linux-next: build failure after merge of all the trees
Date: Mon, 21 Jul 2025 14:42:22 +0300	[thread overview]
Message-ID: <aH4nnsecLEqrCrpK@smile.fi.intel.com> (raw)
In-Reply-To: <20250721173754.42865913@canb.auug.org.au>

On Mon, Jul 21, 2025 at 05:37:54PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging all the trees, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> In file included from drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c:4:
> include/linux/sprintf.h:11:54: error: unknown type name 'va_list'
>    11 | __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
>       |                                                      ^~~~~~~
> include/linux/sprintf.h:1:1: note: 'va_list' is defined in header '<stdarg.h>'; this is probably fixable by adding '#include <stdarg.h>'
>   +++ |+#include <stdarg.h>
>     1 | /* SPDX-License-Identifier: GPL-2.0 */
> include/linux/sprintf.h:13:71: error: unknown type name 'va_list'
>    13 | __printf(3, 0) int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
>       |                                                                       ^~~~~~~
> include/linux/sprintf.h:13:71: note: 'va_list' is defined in header '<stdarg.h>'; this is probably fixable by adding '#include <stdarg.h>'
> include/linux/sprintf.h:15:72: error: unknown type name 'va_list'
>    15 | __printf(3, 0) int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
>       |                                                                        ^~~~~~~
> include/linux/sprintf.h:15:72: note: 'va_list' is defined in header '<stdarg.h>'; this is probably fixable by adding '#include <stdarg.h>'
> include/linux/sprintf.h:17:70: error: unknown type name 'va_list'
>    17 | __printf(2, 0) __malloc char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
>       |                                                                      ^~~~~~~
> include/linux/sprintf.h:17:70: note: 'va_list' is defined in header '<stdarg.h>'; this is probably fixable by adding '#include <stdarg.h>'
> include/linux/sprintf.h:18:73: error: unknown type name 'va_list'
>    18 | __printf(2, 0) const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list args);
>       |                                                                         ^~~~~~~
> include/linux/sprintf.h:18:73: note: 'va_list' is defined in header '<stdarg.h>'; this is probably fixable by adding '#include <stdarg.h>'
> include/linux/sprintf.h:21:55: error: unknown type name 'va_list'
>    21 | __scanf(2, 0) int vsscanf(const char *, const char *, va_list);
>       |                                                       ^~~~~~~
> include/linux/sprintf.h:21:55: note: 'va_list' is defined in header '<stdarg.h>'; this is probably fixable by adding '#include <stdarg.h>'
> 
> I don't know what root caused this, but I have applied the following
> patch for today.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 21 Jul 2025 16:15:57 +1000
> Subject: [PATCH] sprintf.h requires stdarg.h
> 
> In file included from drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c:4:
> include/linux/sprintf.h:11:54: error: unknown type name 'va_list'
>    11 | __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
>       |                                                      ^~~~~~~
> include/linux/sprintf.h:1:1: note: 'va_list' is defined in header '<stdarg.h>'; this is probably fixable by adding '#include <stdarg.h>'
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  include/linux/sprintf.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/sprintf.h b/include/linux/sprintf.h
> index 521bb2cd2648..f06f7b785091 100644
> --- a/include/linux/sprintf.h
> +++ b/include/linux/sprintf.h
> @@ -4,6 +4,7 @@
>  
>  #include <linux/compiler_attributes.h>
>  #include <linux/types.h>
> +#include <linux/stdarg.h>
>  
>  int num_to_str(char *buf, int size, unsigned long long num, unsigned int width);
>  
> -- 
> 2.50.1
> 
> Is there any good reason not to do this?
> 
> I guess this patch should have
> 
> Fixes: 39ced19b9e60 ("lib/vsprintf: split out sprintf() and friends")

This sounds correct to me and your patch should be sent as a fix to the stable
kernels as well.

> but that is not the immediate cause.  This has been exposed by the
> inclusion of a new file
> (drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c in commit
> 7c68005a4610 ("crypto: qat - relocate power management debugfs helper
> APIs").  Maybe every other use of sprintf.h also has (explicitly or
> implicitly) an include of stdarg.h - possibly via kernel.h.

It just a first who started using the header in the correct way without
proxying others.


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-07-21 11:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21  7:37 linux-next: build failure after merge of all the trees Stephen Rothwell
2025-07-21 11:42 ` Andy Shevchenko [this message]
2025-07-21 21:13   ` Andrew Morton
2025-07-21 22:24     ` Stephen Rothwell

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=aH4nnsecLEqrCrpK@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=george.abraham.p@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.