From patchwork Tue Jan 1 21:09:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Santos X-Patchwork-Id: 1922221 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9DB5340D4B for ; Tue, 1 Jan 2013 21:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537Ab3AAVQy (ORCPT ); Tue, 1 Jan 2013 16:16:54 -0500 Received: from nm26.access.bullet.mail.sp2.yahoo.com ([98.139.44.153]:42843 "EHLO nm26.access.bullet.mail.sp2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752448Ab3AAVQu (ORCPT ); Tue, 1 Jan 2013 16:16:50 -0500 Received: from [98.139.44.96] by nm26.access.bullet.mail.sp2.yahoo.com with NNFMP; 01 Jan 2013 21:10:12 -0000 Received: from [98.138.84.175] by tm1.access.bullet.mail.sp2.yahoo.com with NNFMP; 01 Jan 2013 21:10:12 -0000 Received: from [127.0.0.1] by smtp109.sbc.mail.ne1.yahoo.com with NNFMP; 01 Jan 2013 21:10:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=att.net; s=s1024; t=1357074611; bh=pqx+RVGwMwK43m7eFySgrFKzUUVCWUw3wleUtRrFAAw=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=pHSTWC0ZIAVq9F42yKH1U0KchgQloAi3SmtoMWwbk5tcvkta9fGcjgMMqY5ygtEzhBZE1p8PYmxLG8mnqM8Y1UJgnuM9Xt+bhpM431GiGlNRYVYyHMKVmhmzYzyYwT9VfbFVGHdVdu9+DXibdaIYzouxtF4L+9UkAhPAEiMMivM= X-Yahoo-Newman-Id: 982740.17119.bm@smtp109.sbc.mail.ne1.yahoo.com Received: from localhost.localdomain (danielfsantos@99.70.244.137 with login) by smtp109.sbc.mail.ne1.yahoo.com with SMTP; 01 Jan 2013 13:10:11 -0800 PST X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: PpN30rcVM1l_r5yHjI3F87idkiNsiuIak4sxhmU8xl3Tr._ Acw4Q4Jp4JjTn.zpITiCB5XLNS1tx4Hj8eJdgez7I8Y5_9T_rwn1cv.KTNY1 1b7TevHw5IMvkKZuQqK_rHJQvh2GhdiJnvVlb6wAYZ4HObWZFsOeNlFDn2_N urfMJycbA4k8yXztsP0qvUjouoGjzkhcX91Qhkbw.xzZYqzlDKLezkwZv14s 1Vi5HIWLUFuAnONFvJUyT5thwTj.apLYcpMbF67AWMqgNLPWXccs_Nqdb__q rIbFDN7ZrMoxUHtVsbUP6lpO6aWLnHvSRbp6Bi8ztkhh4gP5kT.BJI.qtwVT EseI99gDp6P3coMyGrHlkWyK1zhil9_1SQ6T1Cgirz7foTo4o7h9_nZlMnfv AVtRYRA9O9jgnUsuq6W_ShqQ8RQhhNJlNF1dtA.QMLKPXGQ.L_i.SIUphFJe 9.SpAaeI8zPeSAgEIzVCPySBmL6Yxtw-- X-Yahoo-SMTP: xXkkXk6swBBAi.5wfkIWFW3ugxbrqyhyk_b4Z25Sfu.XGQ-- From: danielfsantos@att.net To: LKML , Andi Kleen , Andrea Arcangeli , Andrew Morton , Borislav Petkov , Christopher Li , David Daney , David Rientjes , Joe Perches , Josh Triplett , linux-sparse@vger.kernel.org, Michel Lespinasse , Paul Gortmaker , Peter Zijlstra , Steven Rostedt Cc: Daniel Santos Subject: [PATCH v7 3/9] compiler-gcc{3,4}.h: Use GCC_VERSION macro Date: Tue, 1 Jan 2013 15:09:51 -0600 Message-Id: <1357074597-21722-3-git-send-email-daniel.santos@pobox.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1357074597-21722-1-git-send-email-daniel.santos@pobox.com> References: <1357074491-21669-1-git-send-email-daniel.santos@pobox.com> <1357074597-21722-1-git-send-email-daniel.santos@pobox.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Using GCC_VERSION reduces complexity, is easier to read and is GCC's recommended mechanism for doing version checks. (Just don't ask me why they didn't define it in the first place.) This also makes it easy to merge compiler-gcc{,3,4}.h should somebody want to. Signed-off-by: Daniel Santos Acked-by: David Rientjes Acked-by: Borislav Petkov --- include/linux/compiler-gcc3.h | 8 ++++---- include/linux/compiler-gcc4.h | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index 37d4124..7d89feb 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h @@ -2,22 +2,22 @@ #error "Please don't include directly, include instead." #endif -#if __GNUC_MINOR__ < 2 +#if GCC_VERSION < 30200 # error Sorry, your compiler is too old - please upgrade it. #endif -#if __GNUC_MINOR__ >= 3 +#if GCC_VERSION >= 30300 # define __used __attribute__((__used__)) #else # define __used __attribute__((__unused__)) #endif -#if __GNUC_MINOR__ >= 4 +#if GCC_VERSION >= 30400 #define __must_check __attribute__((warn_unused_result)) #endif #ifdef CONFIG_GCOV_KERNEL -# if __GNUC_MINOR__ < 4 +# if GCC_VERSION < 30400 # error "GCOV profiling support for gcc versions below 3.4 not included" # endif /* __GNUC_MINOR__ */ #endif /* CONFIG_GCOV_KERNEL */ diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 78090c6..a9ffdfe 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -4,7 +4,7 @@ /* GCC 4.1.[01] miscompiles __weak */ #ifdef __KERNEL__ -# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 +# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 # error Your version of gcc miscompiles the __weak directive # endif #endif @@ -13,11 +13,11 @@ #define __must_check __attribute__((warn_unused_result)) #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) -#if __GNUC_MINOR__ > 0 +#if GCC_VERSION >= 40100 # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) #endif -#if __GNUC_MINOR__ >= 3 +#if GCC_VERSION >= 40300 /* Mark functions as cold. gcc will assume any path leading to a call to them will be unlikely. This means a lot of manual unlikely()s are unnecessary now for any paths leading to the usual suspects @@ -41,9 +41,9 @@ # define __compiletime_warning(message) __attribute__((warning(message))) # define __compiletime_error(message) __attribute__((error(message))) #endif /* __CHECKER__ */ -#endif /* __GNUC_MINOR__ >= 3 */ +#endif /* GCC_VERSION >= 40300 */ -#if __GNUC_MINOR__ >= 5 +#if GCC_VERSION >= 40500 /* * Mark a position in code as unreachable. This can be used to * suppress control flow warnings after asm blocks that transfer @@ -58,9 +58,9 @@ /* Mark a function definition as prohibited from being cloned. */ #define __noclone __attribute__((__noclone__)) -#endif /* __GNUC_MINOR__ >= 5 */ +#endif /* GCC_VERSION >= 40500 */ -#if __GNUC_MINOR__ >= 6 +#if GCC_VERSION >= 40600 /* * Tell the optimizer that something else uses this function or variable. */