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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 D498CC433DB for ; Wed, 17 Mar 2021 18:09:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 264BC64F33 for ; Wed, 17 Mar 2021 18:09:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 264BC64F33 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7C46E6B006E; Wed, 17 Mar 2021 14:09:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7737A6B0070; Wed, 17 Mar 2021 14:09:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5EE126B0071; Wed, 17 Mar 2021 14:09:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 3FCD16B006E for ; Wed, 17 Mar 2021 14:09:08 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C7CD17599 for ; Wed, 17 Mar 2021 18:09:07 +0000 (UTC) X-FDA: 77930152734.16.286BE82 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf20.hostedemail.com (Postfix) with ESMTP id BFDD9EBC20 for ; Wed, 17 Mar 2021 17:36:49 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4F0y583vFpzB09Zd; Wed, 17 Mar 2021 18:36:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id v-2_sLTpHPTF; Wed, 17 Mar 2021 18:36:44 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4F0y582RpmzB09Zb; Wed, 17 Mar 2021 18:36:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 213F28B866; Wed, 17 Mar 2021 18:36:46 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ARYtUs8FK9Ly; Wed, 17 Mar 2021 18:36:46 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5F7D28B865; Wed, 17 Mar 2021 18:36:45 +0100 (CET) Subject: Re: [PATCH mm] kfence: fix printk format for ptrdiff_t To: David Laight , Segher Boessenkool Cc: Alexander Potapenko , Marco Elver , Andrew Morton , Dmitriy Vyukov , Andrey Konovalov , Jann Horn , LKML , Linux Memory Management List , kasan-dev References: <20210303121157.3430807-1-elver@google.com> <20210316153320.GF16691@gate.crashing.org> <3f624e5b-567d-70f9-322f-e721b2df508b@csgroup.eu> <6d4b370dc76543f2ba8ad7c6dcdfc7af@AcuMS.aculab.com> From: Christophe Leroy Message-ID: <001a139e-d4fa-2fd7-348f-173392210dfd@csgroup.eu> Date: Wed, 17 Mar 2021 18:35:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <6d4b370dc76543f2ba8ad7c6dcdfc7af@AcuMS.aculab.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr X-Stat-Signature: 1ajuoe8nrmqnwg7bpuxc76ioqt9eo5o1 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: BFDD9EBC20 Received-SPF: none (csgroup.eu>: No applicable sender policy available) receiver=imf20; identity=mailfrom; envelope-from=""; helo=pegase1.c-s.fr; client-ip=93.17.236.30 X-HE-DKIM-Result: none/none X-HE-Tag: 1616002609-721900 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Le 17/03/2021 =C3=A0 13:51, David Laight a =C3=A9crit=C2=A0: > From: Christophe Leroy >> Sent: 16 March 2021 15:41 > ... >>>> include/linux/types.h:typedef __kernel_ptrdiff_t ptrdiff_t; >>>> >>>> And get: >>>> >>>> CC mm/kfence/report.o >>>> In file included from ./include/linux/printk.h:7, >>>> from ./include/linux/kernel.h:16, >>>> from mm/kfence/report.c:10: >>>> mm/kfence/report.c: In function 'kfence_report_error': >>>> ./include/linux/kern_levels.h:5:18: warning: format '%td' expects ar= gument >>>> of type 'ptrdiff_t', but argument 6 has type 'long int' [-Wformat=3D= ] >>> >>> This is declared as >>> const ptrdiff_t object_index =3D meta ? meta - kfence_metad= ata : -1; >>> so maybe something with that goes wrong? What happens if you delete = the >>> (useless) "const" here? >=20 > The obvious thing to try is changing it to 'int'. > That will break 64bit builds, but if it fixes the 32bit one > it will tell you what type gcc is expecting. >=20 Yes, if defining 'object_index' as int, gcc is happy. If removing the powerpc re-definition of ptrdiff_t typedef in=20 https://elixir.bootlin.com/linux/v5.12-rc3/source/arch/powerpc/include/ua= pi/asm/posix_types.h , it=20 works great as well. So seems like gcc doesn't take into account the typedef behind ptrdiff_t,= it just expects it to be=20 int on 32 bits ? Christophe