Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1937959imm; Mon, 3 Sep 2018 13:35:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYohp8fYIETwz19nj5MrEyQO/j6Rsmdv07uMMnp7YnzW3WL17VBWseW3SMDWvexifyrTNs5 X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr30521333plc.118.1536006927380; Mon, 03 Sep 2018 13:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536006927; cv=none; d=google.com; s=arc-20160816; b=M/LIpUMvimUVcEGJhlIJzId42dGJ/kb+1Fc1GLEf4GPzaNU9awlq1fHm4SGKpviORQ ivLPM/yPcQEWbKg1LEXtcU1xDdYEH9uBeDcoMfaAlMBplKEOFXjBFDcq+AfPxpK66Yfu pCQJWWcvGtQ1Wk7gXrIW1FcF7HJFUZww3rTTrE2NjGrdDt9aNtinV1fUBIVyrVLrGnSG D4PlJVeOQ31CdZKsfBprsy6JXpjQmJIx/aMhLJFSBx0xdXq7qe++aZTwUYjbkQlHaEjE 7CZilZsu7Hp78yDX6WGR9u96zCL/2484BMYQbsPEBzytxWglHCG5qb+pKeL1w7/qlVpR Jniw== 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:arc-authentication-results; bh=HoCi5EJzB+/PbEERt2xyXHFMzpFbJL9r+GdGJgj/E2I=; b=ppywIQ4GlJfCK8rruvLaNndfsWATk/tpvkBIR3abB+0hCL23kxV5VGXcojdjElbOl1 52hUHqKKbTGzTwJlNoai/tv25Y7hwU7YmcGY+erRP5brMysuRn+HK7eaujnDVgpZxCOc iLXtCRVSvRhZvZ4qMh4evc/hpWutrjXj1G+ZsmvOCKssjysofIOnj660phfXwnZyHH5O 539SeZO6ENCaiMfXl5EIe59r4gH9FTj6519rjVpbqyVwNgGfeQYtoi0KOVcIGMK588BI GbNkfh+H4tgEaruh04kNTyydHqrlgBnsIe4GgOtYkGYn9SY0Pk4QR11VR7bcZxgvhz3p cc2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Skx0Jzuz; 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 g185-v6si17465035pgc.151.2018.09.03.13.35.12; Mon, 03 Sep 2018 13:35:27 -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=Skx0Jzuz; 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 S1729068AbeIDAzu (ORCPT + 99 others); Mon, 3 Sep 2018 20:55:50 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41620 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727850AbeIDAzt (ORCPT ); Mon, 3 Sep 2018 20:55:49 -0400 Received: by mail-wr1-f66.google.com with SMTP id z96-v6so1742391wrb.8; Mon, 03 Sep 2018 13:33:57 -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=HoCi5EJzB+/PbEERt2xyXHFMzpFbJL9r+GdGJgj/E2I=; b=Skx0JzuzOifbH6Nu73FZZulPhYCoy3WAHSwkgknIK7riIm3YwzVs+waTWb1cNxZtVE VkljYkOsx8v3stytWW1mgYxYy6bmV76ypJ2+f3uNy6fNHNFbN7h8B4CjDTqdBjptm3KO 7CZPBNWMH4OsPbDuG/Ul8wKoyllhlKj/4qDOqwANo0D4MaBiS74aW4D3HJmf/0NzJVWt rvBKxCOC3MDEebpsDlSdrYki/S20yYioFtUXt2lnBJvpTkTUu0EE5CfTS380S2MxY0ZL QSs5JZmqrfCTJyNhRCh2dIyvESJZZqnBA1VBOwcKx8s34uXqigHg49uOk3WYf96O2T9t 5BbA== 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=HoCi5EJzB+/PbEERt2xyXHFMzpFbJL9r+GdGJgj/E2I=; b=jGD4MJEbnMCvbwgF/qObRhufYoRQx6XiVUjiuzO2+GrjJk7sRUc92WODq7+kWfVXa4 1tVxTCfDIjNiiOqOUvouno9RCwlzDKgvDneU2ABStZKcMnCXZqyAOT0u2t7l2WQ1DymU Q1e1tZfWIJdOjhCghmwkN0ar0BUQQzTmAReLeahdYizYTiC4Vuw233u2Ssg5iUBdvzE3 zs6wf+lhsqbdR/EvRyymoozDGknwaZjH+TVVX28XP1rg5uLBMzjnjPfn8Djjnmxu1G45 MXgRi61Kt8Jv7/IczK6omeVy8QGyH7VVnDBFiF2idL9wdfe+GT+oxIZkghgBV182a7J1 qPfw== X-Gm-Message-State: APzg51DQrlC/b3j7/QAWJaYIwIWivr9fbKaK+ikrgZjyV5oRO2srDhLW Fub1mOwjd2HsbNG+BfgIdyU= X-Received: by 2002:adf:8919:: with SMTP id s25-v6mr20133892wrs.89.1536006836762; Mon, 03 Sep 2018 13:33:56 -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 132-v6sm12354870wmd.13.2018.09.03.13.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 13:33:56 -0700 (PDT) From: Miguel Ojeda To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Miguel Ojeda , Rasmus Villemoes , Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Joe Perches , Dominique Martinet , linux-sparse@vger.kernel.org Subject: [PATCH 07/12] Compiler Attributes: remove unneeded sparse (__CHECKER__) tests Date: Mon, 3 Sep 2018 22:33:11 +0200 Message-Id: <20180903203316.16183-8-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180903203316.16183-1-miguel.ojeda.sandonis@gmail.com> References: <20180903203316.16183-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__ Cc: Rasmus Villemoes Cc: Eli Friedman Cc: Christopher Li Cc: Kees Cook Cc: Ingo Molnar Cc: Geert Uytterhoeven Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Joe Perches Cc: Dominique Martinet Cc: Linus Torvalds Cc: linux-sparse@vger.kernel.org Acked-by: Luc Van Oostenryck Reviewed-by: Nick Desaulniers 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 f182f2ef3227..65b10b1e2a59 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -217,7 +217,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