From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE20FC433E9 for ; Fri, 12 Feb 2021 10:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DC6F64E85 for ; Fri, 12 Feb 2021 10:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230468AbhBLK5N (ORCPT ); Fri, 12 Feb 2021 05:57:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:57332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbhBLK5I (ORCPT ); Fri, 12 Feb 2021 05:57:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DEBF864E2D; Fri, 12 Feb 2021 10:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613127387; bh=LKxrbsHmARhR1BNS8+KpMMyPCTW+fzv/xMzqI7/b6gU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OQ2vX+2r0rHA0YhF/7aY87gTuOZyHUtIRn6NOkZxzpDzlBW5Dq3/Zyl30hI1sTkwy ULpeuLcosyi47SElwpDTJZ0EB/Z05hOtlZEcv9GA2dxJyktrVude6n6DFabdRIhIWK bdix2atvQ2e5UqS5ZtJS59740lfGr4ctl+1aKi8n6R47XmXad8d5jDtmbfPUeRpkXc Etr+4bIRDlFTIJnMSgZNQOQyraSCNV6dTbweQLmxGkMkhdV/tOVwBhJyR0GpTDp45O pGFBBQ95SOtIIrnJQmxaYVoQVXXt18TDPYqHeYF8sWN5fybFjLNQdKifoZmHqLPnn0 oF3JroTrA+JjQ== Date: Fri, 12 Feb 2021 12:56:18 +0200 From: Jarkko Sakkinen To: Randy Dunlap Cc: linux-kernel@vger.kernel.org, Sean Christopherson , Borislav Petkov , x86@kernel.org Subject: Re: [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h Message-ID: References: <20210209012305.31062-1-rdunlap@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209012305.31062-1-rdunlap@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 05:23:05PM -0800, Randy Dunlap wrote: > Use %zu instead of %lu for size_t to prevent w printf() > format warnings in vdso2c.h > > HOSTCC arch/x86/entry/vdso/vdso2c > In file included from ../arch/x86/entry/vdso/vdso2c.c:162: > ../arch/x86/entry/vdso/vdso2c.h: In function 'extract64': > ../arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=] > 38 | fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len); > | ~~^ ~~~ > In file included from ../arch/x86/entry/vdso/vdso2c.c:166: > ../arch/x86/entry/vdso/vdso2c.h: In function 'extract32': > ../arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=] > 38 | fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len); > | ~~^ ~~~ > > Fixes: 8382c668ce4f ("x86/vdso: Add support for exception fixup in vDSO functions") > Signed-off-by: Randy Dunlap > Cc: Sean Christopherson > Cc: Jarkko Sakkinen > Cc: Borislav Petkov > Cc: x86@kernel.org Just a *question*: should SOB be the last? Seeing this 2nd time today, and just not used to it. That's why asking. Anyway, thank you. Reviewed-by: Jarkko Sakkinen > --- > arch/x86/entry/vdso/vdso2c.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- lnx-511-rc7.orig/arch/x86/entry/vdso/vdso2c.h > +++ lnx-511-rc7/arch/x86/entry/vdso/vdso2c.h > @@ -35,7 +35,7 @@ static void BITSFUNC(extract)(const unsi > if (offset + len > data_len) > fail("section to extract overruns input data"); > > - fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len); > + fprintf(outfile, "static const unsigned char %s[%zu] = {", name, len); > BITSFUNC(copy)(outfile, data + offset, len); > fprintf(outfile, "\n};\n\n"); > } > /Jarkko