From patchwork Tue Jul 23 07:44:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169486 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8532260ilk; Tue, 23 Jul 2019 00:45:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0wgqg/KR+W01tEu4Qz+g7WjUeDVnmR+JZQ3khrMM6WYVqPsNvHW49DrAKPC70N4mBdrn+ X-Received: by 2002:a17:90a:3344:: with SMTP id m62mr81352101pjb.135.1563867939729; Tue, 23 Jul 2019 00:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563867939; cv=none; d=google.com; s=arc-20160816; b=pK4F0UsmdSYcV3uxt0xmyh5NAOgtuTdKEYIDuCPoc7XNfBR3gaE6q+6DGRSPLzh7hv XG2d4gcwRRla8JSdXja2Hk7oRhA/CkvwVrpSH6ogYeVyNku52vEdvyU7oI9PATL1kxbl 8r0sPrittd3OqDUdKVtm7isdsNNTrjoCCdJjci5EDpgiwEDib93pG2EOkR9bTJ8LjD8g uFsefQOpPMTvnxx6h8l7E7UXrpi5slilMDWGtI7Wd21EjZ4oE2CDY84ZQkOkBV2c/PjU YW+cRYKrqW8NpiRJwEovFaKUBXNLWmJ6Hv1aswhE3hihsBBuOduMQ+ahUeuQ30O8tMUX CtHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=wwv9Z4pZlsh4ouUjX2bu7iJJkEhowNuVCO6yDuN4jeI=; b=bH245G6kWxecuSt8HPE+Fdzu5fEwwm1kVqGGwpad5XQd99wJmpSEj/dpQEkV0DL9B2 1R1F5cJEjKO2fveeFV0sL2D6NoAtNvqKvvHzHuAwTZxwsN+DWf7HXSQLvsaUSrSZ/eLg gggUtrSpIAfk418rfIBCbudU4/PWwdd8eukJJliMhTphwx71mKr8o1DdM7x6P0+b02Rk Sf479sQgO19aw1t4l0C1o0EiK+LYd9Kq4l6JQidEqlNyBRpzx4A4rC3DNCE2aMzgkR/0 Prrv57Kf79boXmFA91yT9S2sW7aJjCE5N+86SQ4mGV2R4PvhN4nHAJuyQkraM2Imcj8O XjkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BhHsw2xN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t134si12820442pgc.361.2019.07.23.00.45.39; Tue, 23 Jul 2019 00:45:39 -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=@nifty.com header.s=dec2015msa header.b=BhHsw2xN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388505AbfGWHpi (ORCPT + 29 others); Tue, 23 Jul 2019 03:45:38 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:42702 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730807AbfGWHph (ORCPT ); Tue, 23 Jul 2019 03:45:37 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x6N7iKrX025153; Tue, 23 Jul 2019 16:44:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x6N7iKrX025153 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563867861; bh=wwv9Z4pZlsh4ouUjX2bu7iJJkEhowNuVCO6yDuN4jeI=; h=From:To:Cc:Subject:Date:From; b=BhHsw2xNxb2pM2O70xKTlcZzAINovN12204RlfSQTdJTCYPWJGlu1UDXPnR7IdUpT p5k6mccVpfiq7h+oFeuiA60ael6+5nifdZPsCIzAyIZijccu9FQGBj4uvJR5GdNKd/ 4TNeZS2U4Lc7JmmECIvgOPCM63Jj+0Sq+GMmykmxJiW9LqrePde1mmKHlLqFt9VUrg wb8vagV/CQCk0xgtgXLrIy9znauqxm5XJERORZMCKUkERo/DvqNsP/l8ILakvykm66 kVAfV8VuGm/ig6Be6SY9Vvcn8Hr/aiDYl/1Z02hRVPbHUL2A2j/4UZKk62291x1UVB pnr5X3oE64wEg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Ingo Molnar , Thomas Gleixner , x86@kernel.org Cc: Masahiro Yamada , Borislav Petkov , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH] x86: use __builtin_constant_p() directly instead of IS_IMMEDIATE() Date: Tue, 23 Jul 2019 16:44:15 +0900 Message-Id: <20190723074415.26811-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __builtin_constant_p(nr) is used everywhere now. It does not make much sense to define IS_IMMEDIATE() as its alias. Signed-off-by: Masahiro Yamada --- arch/x86/include/asm/bitops.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index ba15d53c1ca7..7d1f6a49bfae 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h @@ -45,14 +45,13 @@ * We do the locked ops that don't return the old value as * a mask operation on a byte. */ -#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) #define CONST_MASK_ADDR(nr, addr) WBYTE_ADDR((void *)(addr) + ((nr)>>3)) #define CONST_MASK(nr) (1 << ((nr) & 7)) static __always_inline void arch_set_bit(long nr, volatile unsigned long *addr) { - if (IS_IMMEDIATE(nr)) { + if (__builtin_constant_p(nr)) { asm volatile(LOCK_PREFIX "orb %1,%0" : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)CONST_MASK(nr)) @@ -72,7 +71,7 @@ arch___set_bit(long nr, volatile unsigned long *addr) static __always_inline void arch_clear_bit(long nr, volatile unsigned long *addr) { - if (IS_IMMEDIATE(nr)) { + if (__builtin_constant_p(nr)) { asm volatile(LOCK_PREFIX "andb %1,%0" : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)~CONST_MASK(nr))); @@ -123,7 +122,7 @@ arch___change_bit(long nr, volatile unsigned long *addr) static __always_inline void arch_change_bit(long nr, volatile unsigned long *addr) { - if (IS_IMMEDIATE(nr)) { + if (__builtin_constant_p(nr)) { asm volatile(LOCK_PREFIX "xorb %1,%0" : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)CONST_MASK(nr)));