Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756696AbcJ1VeV convert rfc822-to-8bit (ORCPT ); Fri, 28 Oct 2016 17:34:21 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:54550 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752675AbcJ1VeT (ORCPT ); Fri, 28 Oct 2016 17:34:19 -0400 From: Arnd Bergmann To: Vineet Gupta Cc: lkml , arcml , Claudiu Zissulescu Subject: Re: [PATCH] lpfc: use %zd format string for size_t Date: Fri, 28 Oct 2016 23:33:45 +0200 Message-ID: <18294392.WY3416IpNg@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <26e675e3-af5b-eaf7-fea0-b4aff9767332@synopsys.com> References: <20161017123605.2217411-1-arnd@arndb.de> <26e675e3-af5b-eaf7-fea0-b4aff9767332@synopsys.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K0:c6+EiydjKi4pm/z3tFBSz5gUA40sW4lA6IvEYXM7y1HwsXCofgy 8fvNgnkdBH2i8eDgWVO2KRGlPGQ8URW89dV+FrmP2WejopCJe2ZGwofUZCDiuUkimaXA1Ah yfWsmqI7W0LYB7nAB5bladMVsMRIyAEIi+5xYwCCbLePynDtUs+QSdzv2z93bWyKV6ts6E8 QOyCd0qUQ9vkfKVx7JNbA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Fq/E0w+ah94=:syWOvMpxleUIqEMe11R7f+ VY853KHxEhOqhMlG+VLxyt/wYPUJEia+WxDYkSAE0wiOIn/OtJjG2XtMwaiTmbNsj6UUeZ4mv NA+hPx3pj1saAczW+zYKAGMRO7hWAn6W/n+uYKQvkdFiF0zlFNLMtgbUN/Xlc05SGUgG2djKs nGgm4ULjnx1j2XpGFh1tCfJKqcWji8y1vZ6Fmw0Kxl1xZZV87wfkZhvwSqqZJs6PbCCXaLQaC RA37CP5EGXxlGb9vkXQsltcSlznGCxUJ+yPC8vOt9CC9ronbvcjyxypWVlg2sFpPNDUgOOnZF A6xoFC+3GvyWEIvXe7sC8Z2Ozxgwbxub/JcgAc+kPmH97PDT0kEP7OfRzGb50aNaHZUU5uNAC lqh1bK+AP0J2I8yAwNph8q7G8xiW5704ypOK/ZEqlk9iK5ET+57ts0teM+mX3pgJpDUEYN939 ZCP7wHbPGqGJmI/O1lC38aE0wbRRtk2+dfXMo0Jgo7TWXSuiSRchxKiuO1Ob7gbh5euL6Sl+8 XZHzisDFgOhLcZAVOFNU90qwSpTLG4F0CS6vaEwwsjB/6Fd4xPRMQ8TyvyG6vhM+MXTlza5eC c+MRgrte1aWhBZQAlpwyLjMlqEFJW97LHo43G+aE5SyHK5wpMk2P1TXQBl84hYrh9koRVNXWl K9zRy5jKKfnw6HqyGK8Axa0CdA5FCakANvGRFrsoMkY/LteV/S1RFqcJH8StJTVz85JP/n1d7 QipyLvxv+oGL3oiG Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1975 Lines: 45 On Friday, October 28, 2016 2:03:21 PM CEST Vineet Gupta wrote: > > I'm trying to use about to be released ARC gcc 6.x with current kernels and see a > flood of warnings due to these legit fixes - i.e.g arc gcc 6.2 complains when it > sees -zx formats. > > CC mm/percpu.o > ../mm/percpu.c: In function ‘pcpu_alloc’: > ../mm/percpu.c:890:14: warning: format ‘%zu’ expects argument of type ‘size_t’, > but argument 4 has type ‘unsigned int’ [-Wformat=] > WARN(true, "illegal size (%zu) or align (%zu) for percpu allocation\n", > > I'm not sure what is going on since the data type is size_t alright - although > from posix_types.h is > > typedef unsigned int __kernel_size_t; > typedef __kernel_size_t size_t; > > And this seems to be same for ARC as well as ARM. I tried ARM gcc 6.1 @ > https://snapshots.linaro.org/components/toolchain/binaries/6.1-2016.08-rc1/arm-linux-gnueabihf/ > > which doesn't seem to be complaining. > > With V=1, I checked the respective ARM and ARC toggles in play, but nothing > related to this seems to be standing out. > > I know this is more of a question to our GNU folks, but was wondering if you had > more insight into it - which you almost always do I've seen the problem you describe before, but I don't remember the exact details. I think what happened is that the compiler knows what type size_t is supposed to be, either unsigned int or unsigned long, regardless of what our kernel headers say it is. This is configuration specific, and something caused your compiler to be built assuming that size_t is unsigned long, while the kernel headers are assuming it should be unsigned int. You can try overriding __kernel_size_t in your asm/posix_types.h to define it as unsigned long, or try to build your compiler to match the kernel headers, but the first step would be to find out why the compiler changed in the first place, assuming that older compiler versions were matching the kernel here. Arnd