Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2274913imm; Thu, 20 Sep 2018 10:24:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZrmpqyCNqZssoNEe9y4vj3XuwYcxpfFHDAcs4H2eb28bulEfVRfrf/vmev9kgkoRcDUXoS X-Received: by 2002:a63:5465:: with SMTP id e37-v6mr6276675pgm.316.1537464272189; Thu, 20 Sep 2018 10:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537464272; cv=none; d=google.com; s=arc-20160816; b=n/mdIb/JMFEgx0QLa6NrkQ3n6opYZyMU+mZdRfGAG2UTbnxtk0JT6O0pM1p8FxO5zO DpDfHy4sfXEhaOZZW6xVefAnQBv50kRjmyZ2YdqvOh7aChWefxYrWX/fIP1eE0xN7X1T KlJh9GSPNAXFqjfY7Y4aDVRCdSPEUeh5ejRwzQF4vUDY2H7tVqGrDMdYQZOGaJQlNxyI sgLpwJiBedqkzKrpMJ0HIVQ64pGMo+yO0L/EMeqNdzj6Xsw7NgUlt6RMu06xKMeaEu+O C91Ub5/YBg9xY0Myom1ueYvVs+WIoE2YThEmudstjzZ8xFmhGDsi7nrs52HLUIioBX8e 7aaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=IOszDx0+PcEdvwwbT4AXK0NljevKHMGsY/DMk4sv7Dc=; b=DpOcncR03wupOtMC869vAqkxi6OFpfX5LbBaWPPYD/kyabgJ3jEYatZ3PBjAckxThf 3PqAHm0etRZh6H0Wsihr0YL8422GW14xuzkImv938T2ra90tA8nMGvM4PmxkCRb/kh9s tv0yOICHand2nP1T56Vat/4QwctFi0fGQTBrCsvZICzeGZdQiEF8hZOi+s4z4NasuV03 Jb5zUPGjgLTPo7iCPY7bmaq7OJ4m2v11joO7nqkKRt3EF7j+Zpv/5Kro6EpUQqdVZapp I4VRo8m1db1gxWg6yPdkNsvMEUShihhDnkw259TVAAu+IFqFoO+9RKmT7GUA6theiARS Eukw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K7ExAC7J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 200-v6si24732441pfv.137.2018.09.20.10.24.16; Thu, 20 Sep 2018 10:24:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K7ExAC7J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388084AbeITXII (ORCPT + 99 others); Thu, 20 Sep 2018 19:08:08 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52804 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387922AbeITXIH (ORCPT ); Thu, 20 Sep 2018 19:08:07 -0400 Received: by mail-wm1-f68.google.com with SMTP id y139-v6so328953wmc.2; Thu, 20 Sep 2018 10:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IOszDx0+PcEdvwwbT4AXK0NljevKHMGsY/DMk4sv7Dc=; b=K7ExAC7JSD0agyD0RvT0q8cXvC6yEwbBU5+ykXIOb+fSS5+GmbFI8qRKBnHHSAl6Gz LH3upOYhlPJeSLNliTYbPHhZUHarvUr1rYsDeI+YOEKfm+hDl6C4EiqHHv4Pqr+IC5P9 ZFjAA4ms4dmAtT63dhBSRPskues4ak2YKbXgm+QMfHpgLeYYWhN/XVkxhkv7ooJ37oKV ok6F/EqrChPWLciCEcTBk4eEGBCks5zxt1KxTsKsmFPE4xEFqsOSAhsO2JTH4cuEkDpt dbKkAlVdnS6WZBY3/tXTowYfLrt2tRRIeqk6ZzMZonfmidOO3LZgagDGG/9x7Vb+S75j mHZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IOszDx0+PcEdvwwbT4AXK0NljevKHMGsY/DMk4sv7Dc=; b=kYN5RSQ6hm2hu1GdqPOBLOBi+9y5yRrHpTXI1sPM7+/T/P3kTpFnG6hgvL9zveCTI1 h995R05Y1nO0yvQHHHJIA6F8J0X4v7N+t1C9Nm+hX53WQ8E/99j9g4GVkcN4aNBgdY+V gGfOJKexi2wxTnMtSNTjB+eTk+1V5rBPiqEe3Umlr5PDdnY+NZnOc+x6o0vRCOfG2P1W rkMaPI9Nn8vO7nFgZKGrqjsE5QoV00ZqKQ6R9XIFYhhaK439bHpFOhvWwCQ3M3mTjT3P HMed/8AbF0T/63gZRyRwNaRPsxnWfabOyBd8guo0WEIddKs8omp8/duNCK7Oe8EQf8TY YVqw== X-Gm-Message-State: ABuFfohRiW0GSp0yE8utboljIX0AeOGWyCI+Ktz0bzHuw2Wg18WXCieU WagQFOfKZIJv6ug6Mtz8rCo= X-Received: by 2002:a1c:c3:: with SMTP id 186-v6mr3949415wma.126.1537464215294; Thu, 20 Sep 2018 10:23:35 -0700 (PDT) Received: from localhost.localdomain (62.83.35.8.dyn.user.ono.com. [62.83.35.8]) by smtp.gmail.com with ESMTPSA id q200-v6sm3466562wmd.2.2018.09.20.10.23.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 10:23:34 -0700 (PDT) From: Miguel Ojeda To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Miguel Ojeda , Andreas Dilger , Masahiro Yamada , Michal Marek , Steven Rostedt , Mauro Carvalho Chehab , Olof Johansson , Konstantin Ryabitsev , "David S . Miller" , Andrey Ryabinin , Kees Cook , Thomas Gleixner , Ingo Molnar , Paul Lawrence , Sandipan Das , Andrey Konovalov , David Woodhouse , Will Deacon , Philippe Ombredanne , Paul Burton , David Rientjes , Willy Tarreau , Martin Sebor , Christopher Li , Jonathan Corbet , Theodore Ts'o , Geert Uytterhoeven , Rasmus Villemoes , Joe Perches , Arnd Bergmann , Dominique Martinet , Stefan Agner , Luc Van Oostenryck , Nick Desaulniers , Andrew Morton , Linus Torvalds , linux-doc@vger.kernel.org, linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH v5 05/15] Compiler Attributes: remove unneeded sparse (__CHECKER__) tests Date: Thu, 20 Sep 2018 19:22:51 +0200 Message-Id: <20180920172301.21868-6-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180920172301.21868-1-miguel.ojeda.sandonis@gmail.com> References: <20180920172301.21868-1-miguel.ojeda.sandonis@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse knows about a few more attributes now, so we can remove the __CHECKER__ conditions from them (which, in turn, allow us to move some of them later on to compiler_attributes.h). * assume_aligned: since sparse's commit ffc860b ("sparse: ignore __assume_aligned__ attribute"), included in 0.5.1 * error: since sparse's commit 0a04210 ("sparse: Add 'error' to ignored attributes"), included in 0.5.0 * hotpatch: since sparse's commit 6043210 ("sparse/parse.c: ignore hotpatch attribute"), included in 0.5.1 * warning: since sparse's commit 977365d ("Avoid "attribute 'warning': unknown attribute" warning"), included in 0.4.2 On top of that, __must_be_array does not need it either because: * Even ancient versions of sparse do not have a problem * BUILD_BUG_ON_ZERO() is currently disabled for __CHECKER__ Reviewed-by: Nick Desaulniers Reviewed-by: Luc Van Oostenryck Signed-off-by: Miguel Ojeda --- include/linux/compiler-gcc.h | 6 ++---- include/linux/compiler.h | 4 ---- include/linux/compiler_types.h | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 3b32bbfa5a49..1ca6a51cfaa9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -76,14 +76,12 @@ #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) -#ifndef __CHECKER__ #define __compiletime_warning(message) __attribute__((__warning__(message))) #define __compiletime_error(message) __attribute__((__error__(message))) -#ifdef LATENT_ENTROPY_PLUGIN +#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__) #define __latent_entropy __attribute__((latent_entropy)) #endif -#endif /* __CHECKER__ */ /* * calling noreturn functions, __builtin_unreachable() and __builtin_trap() @@ -131,7 +129,7 @@ /* gcc version specific checks */ -#if GCC_VERSION >= 40900 && !defined(__CHECKER__) +#if GCC_VERSION >= 40900 /* * __assume_aligned(n, k): Tell the optimizer that the returned * pointer can be assumed to be k modulo n. The second argument is diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 165b1d5683ed..4030a2940d6b 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -357,11 +357,7 @@ static inline void *offset_to_ptr(const int *off) compiletime_assert(__native_word(t), \ "Need native word sized stores/loads for atomicity.") -#ifdef __CHECKER__ -#define __must_be_array(a) 0 -#else /* &a[0] degrades to a pointer: a different type from an array */ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) -#endif #endif /* __LINUX_COMPILER_H */ diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 5ff9cda893f4..a3eceb3ad1b3 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -218,7 +218,7 @@ struct ftrace_likely_data { #define __must_check #endif -#if defined(CC_USING_HOTPATCH) && !defined(__CHECKER__) +#if defined(CC_USING_HOTPATCH) #define notrace __attribute__((hotpatch(0, 0))) #else #define notrace __attribute__((__no_instrument_function__)) -- 2.17.1