[PATCH 2/2] ARM64: Add printf annotation to early_print

Catalin Marinas catalin.marinas at arm.com
Tue Oct 14 02:43:10 PDT 2014


On Tue, Oct 14, 2014 at 09:59:29AM +0100, Alexander Stein wrote:
> This adds the printf format annotation to early_print to warn users about
> incompatible formats and argument.
> 
> Signed-off-by: Alexander Stein <alexander.stein at systec-electronic.com>
> ---
>  arch/arm64/kernel/setup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index edb146d..bbf633b 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -102,7 +102,7 @@ static struct resource mem_res[] = {
>  #define kernel_code mem_res[0]
>  #define kernel_data mem_res[1]
>  
> -void __init early_print(const char *str, ...)
> +void __init __printf(1, 2) early_print(const char *str, ...)
>  {
>  	char buf[256];
>  	va_list ap;

I wonder if we need this function at all on arm64. Early on, we used
something similar to the 32-bit ARM printascii but with an early console
now, we go through the printk anyway so I think we can just remove this
function (it has a single caller anyway on arm64).

-- 
Catalin



More information about the linux-arm-kernel mailing list