From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389AbbJITkh (ORCPT ); Fri, 9 Oct 2015 15:40:37 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36214 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbbJITkf (ORCPT ); Fri, 9 Oct 2015 15:40:35 -0400 From: Rasmus Villemoes To: Valdis Kletnieks Cc: Christoph Lameter , linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: slab.h debugging tags.... Organization: D03 References: <173313.1444349570@turing-police.cc.vt.edu> X-Hashcash: 1:20:151009:cl@linux.com::8g+nDhA3jYi4bl7R:0000026k4 X-Hashcash: 1:20:151009:valdis.kletnieks@vt.edu::9aeuZdESxIhuVRtn:000000000000000000000000000000000000006YVl X-Hashcash: 1:20:151009:linux-kernel@vger.kernel.org::8ejCrcGY1SzQmMi+:00000000000000000000000000000000080Xk Date: Fri, 09 Oct 2015 21:40:33 +0200 In-Reply-To: <173313.1444349570@turing-police.cc.vt.edu> (Valdis Kletnieks's message of "Thu, 08 Oct 2015 20:12:50 -0400") Message-ID: <87pp0n96fi.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 09 2015, Valdis Kletnieks wrote: > Author: Rasmus Villemoes > Date: Wed Oct 7 15:09:20 2015 +1100 > > slab.h: sprinkle __assume_aligned attributes > > causes *tons* of whinges if you do 'make C=2' with sparse 0.5.0: > > CHECK drivers/media/usb/pwc/pwc-if.c > include/linux/slab.h:307:43: error: attribute '__assume_aligned__': unknown attribute > include/linux/slab.h:308:58: error: attribute '__assume_aligned__': unknown attribute > include/linux/slab.h:337:73: error: attribute '__assume_aligned__': unknown attribute > include/linux/slab.h:375:74: error: attribute '__assume_aligned__': unknown attribute > include/linux/slab.h:378:80: error: attribute '__assume_aligned__': unknown attribute > > [/usr/src/linux-next] grep CHECK build.default | wc > 1779 3558 59132 > [/usr/src/linux-next] grep slab.h build.default | wc > 7225 43350 621350 > > Canned it after about 1/3 of the build. > > Where's a sparse that can handle this? I don't think there is any (sparse 0.5 seems to be the latest). Hm, if I'm reading the sparse source correctly, it is pretending to be whatever gcc version it itself is built with. That's... um... let's just say odd. Does this fix it for you? Subject: [PATCH] slab.h: hide assume_aligned attribute from sparse sparse apparently pretends to be gcc >= 4.9, yet isn't prepared to handle all the function attributes supported by those gccs and complains loudly. So hide the definition of __assume_aligned from it (so that the generic one in compiler.h gets used). Reported-by: Valdis Kletnieks Signed-off-by: Rasmus Villemoes --- include/linux/compiler-gcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 18606a460baf..dc13ceeef8c8 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -211,7 +211,7 @@ #endif -#if GCC_VERSION >= 40900 +#if GCC_VERSION >= 40900 && !defined(__CHECKER__) /* * __assume_aligned(n, k): Tell the optimizer that the returned * pointer can be assumed to be k modulo n. The second argument is