Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp51883ybi; Thu, 13 Jun 2019 11:27:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxX6KjedIclbZiF2RS5KGifhHmk0lXSYx9DbuklNWTYEmDy/tPyykeSDBrnFGzeiWHKk5Mx X-Received: by 2002:a17:90a:ac0e:: with SMTP id o14mr7021348pjq.142.1560450432426; Thu, 13 Jun 2019 11:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560450432; cv=none; d=google.com; s=arc-20160816; b=PIAjxqRnEnBEt07sTINAwl3x9lDQ3DESQMkL72MZCGYNMPhIcKBZlt1btaZUQfqLDw /7zeZKNBqsZzM7Dhsktjyf3hZhz/2phvvxlJ37pAkUrVUyj6uu0Xyu9IMP8j8FTaLqj8 bh+7LK3aJCUybHnMKXReTugR4A04mkReqVMIR+kq/6wGoRJ/p8oizvargExYGQmE/x8n CiDHRPn18FVf5fBCWtX2RskVXRYXbqfqGJO3l4HZjBh3RGiQ/3XeReXKLn//U1ddIsLv skduwhJqEVy4Ja/PGPP6+7G3j+blS/HBJhNb5lrnI1XvtJwpo1NvjoE2QNhYE3CllzvI RJ9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=fJa8LPOSneCq/Tm4+b0t77eUlVmc1HvQYsuiGC2pyLA=; b=ByibU6J62HVOnEz6vRlCRi5TZy5qWQ/sHcNZj5Le3aVfVyUxyClkqLLODwLV5BcgMX gsV62E3pY+t1FEn2CWpGzQqVtYyPiKZiHZPDKwZcHk07EbF5pTESqoo3xdw6bFv54874 GFDxQxZ34aYttkXz9aV3n77EOGVRmiS9vXd10qS1tfSEV+DlvwYPrUMoBbVLNSLp2Vwg zNkSJio/OhEX2uk9cC70+zwgGchpw6PE0XN1Kqy9b9O0W5KA8w0o+1yB90bLsLztXYwW xWQt6QQ+QHr9Y0hrQhB+0mVkJg0gWWL5NTFvAPBKffVlLwbafH75e/jwOKJvukukBw9N TGOg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si406271pgr.329.2019.06.13.11.26.57; Thu, 13 Jun 2019 11:27:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbfFMS0k (ORCPT + 99 others); Thu, 13 Jun 2019 14:26:40 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36852 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727314AbfFMS0j (ORCPT ); Thu, 13 Jun 2019 14:26:39 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5DIHFP6118168; Thu, 13 Jun 2019 14:26:16 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t3ufr0pha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2019 14:26:16 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x5DI9IQD019216; Thu, 13 Jun 2019 18:10:09 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma01dal.us.ibm.com with ESMTP id 2t1x6t00yc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2019 18:10:09 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5DIQEjo7733510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 18:26:14 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E0CF112065; Thu, 13 Jun 2019 18:26:14 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4164B112061; Thu, 13 Jun 2019 18:26:13 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.170]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 13 Jun 2019 18:26:13 +0000 (GMT) From: Leonardo Bras To: Michael Ellerman Cc: Leonardo Bras , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] Replaces long number representation by BIT() macro Date: Thu, 13 Jun 2019 15:02:27 -0300 Message-Id: <20190613180227.29558-1-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-13_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906130134 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The main reason of this change is to make these bitmasks more readable. The macro ASM_CONST() just appends an UL to it's parameter, so it can be easily replaced by BIT_MASK, that already uses a UL representation. ASM_CONST() in this file may behave different if __ASSEMBLY__ is defined, as it is used on .S files, just leaving the parameter as is. However, I have noticed no difference in the generated binary after this change. Signed-off-by: Leonardo Bras --- arch/powerpc/include/asm/firmware.h | 75 ++++++++++++++--------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h index 00bc42d95679..7a5b0cc0bc85 100644 --- a/arch/powerpc/include/asm/firmware.h +++ b/arch/powerpc/include/asm/firmware.h @@ -14,46 +14,45 @@ #ifdef __KERNEL__ -#include - +#include /* firmware feature bitmask values */ -#define FW_FEATURE_PFT ASM_CONST(0x0000000000000001) -#define FW_FEATURE_TCE ASM_CONST(0x0000000000000002) -#define FW_FEATURE_SPRG0 ASM_CONST(0x0000000000000004) -#define FW_FEATURE_DABR ASM_CONST(0x0000000000000008) -#define FW_FEATURE_COPY ASM_CONST(0x0000000000000010) -#define FW_FEATURE_ASR ASM_CONST(0x0000000000000020) -#define FW_FEATURE_DEBUG ASM_CONST(0x0000000000000040) -#define FW_FEATURE_TERM ASM_CONST(0x0000000000000080) -#define FW_FEATURE_PERF ASM_CONST(0x0000000000000100) -#define FW_FEATURE_DUMP ASM_CONST(0x0000000000000200) -#define FW_FEATURE_INTERRUPT ASM_CONST(0x0000000000000400) -#define FW_FEATURE_MIGRATE ASM_CONST(0x0000000000000800) -#define FW_FEATURE_PERFMON ASM_CONST(0x0000000000001000) -#define FW_FEATURE_CRQ ASM_CONST(0x0000000000002000) -#define FW_FEATURE_VIO ASM_CONST(0x0000000000004000) -#define FW_FEATURE_RDMA ASM_CONST(0x0000000000008000) -#define FW_FEATURE_LLAN ASM_CONST(0x0000000000010000) -#define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000000020000) -#define FW_FEATURE_XDABR ASM_CONST(0x0000000000040000) -#define FW_FEATURE_MULTITCE ASM_CONST(0x0000000000080000) -#define FW_FEATURE_SPLPAR ASM_CONST(0x0000000000100000) -#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) -#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) -#define FW_FEATURE_HPT_RESIZE ASM_CONST(0x0000000001000000) -#define FW_FEATURE_CMO ASM_CONST(0x0000000002000000) -#define FW_FEATURE_VPHN ASM_CONST(0x0000000004000000) -#define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000) -#define FW_FEATURE_OPAL ASM_CONST(0x0000000010000000) -#define FW_FEATURE_SET_MODE ASM_CONST(0x0000000040000000) -#define FW_FEATURE_BEST_ENERGY ASM_CONST(0x0000000080000000) -#define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000) -#define FW_FEATURE_PRRN ASM_CONST(0x0000000200000000) -#define FW_FEATURE_DRMEM_V2 ASM_CONST(0x0000000400000000) -#define FW_FEATURE_DRC_INFO ASM_CONST(0x0000000800000000) -#define FW_FEATURE_BLOCK_REMOVE ASM_CONST(0x0000001000000000) -#define FW_FEATURE_PAPR_SCM ASM_CONST(0x0000002000000000) +#define FW_FEATURE_PFT BIT(0) +#define FW_FEATURE_TCE BIT(1) +#define FW_FEATURE_SPRG0 BIT(2) +#define FW_FEATURE_DABR BIT(3) +#define FW_FEATURE_COPY BIT(4) +#define FW_FEATURE_ASR BIT(5) +#define FW_FEATURE_DEBUG BIT(6) +#define FW_FEATURE_TERM BIT(7) +#define FW_FEATURE_PERF BIT(8) +#define FW_FEATURE_DUMP BIT(9) +#define FW_FEATURE_INTERRUPT BIT(10) +#define FW_FEATURE_MIGRATE BIT(11) +#define FW_FEATURE_PERFMON BIT(12) +#define FW_FEATURE_CRQ BIT(13) +#define FW_FEATURE_VIO BIT(14) +#define FW_FEATURE_RDMA BIT(15) +#define FW_FEATURE_LLAN BIT(16) +#define FW_FEATURE_BULK_REMOVE BIT(17) +#define FW_FEATURE_XDABR BIT(18) +#define FW_FEATURE_MULTITCE BIT(19) +#define FW_FEATURE_SPLPAR BIT(20) +#define FW_FEATURE_LPAR BIT(22) +#define FW_FEATURE_PS3_LV1 BIT(23) +#define FW_FEATURE_HPT_RESIZE BIT(24) +#define FW_FEATURE_CMO BIT(25) +#define FW_FEATURE_VPHN BIT(26) +#define FW_FEATURE_XCMO BIT(27) +#define FW_FEATURE_OPAL BIT(28) +#define FW_FEATURE_SET_MODE BIT(30) +#define FW_FEATURE_BEST_ENERGY BIT(31) +#define FW_FEATURE_TYPE1_AFFINITY BIT(32) +#define FW_FEATURE_PRRN BIT(33) +#define FW_FEATURE_DRMEM_V2 BIT(34) +#define FW_FEATURE_DRC_INFO BIT(35) +#define FW_FEATURE_BLOCK_REMOVE BIT(36) +#define FW_FEATURE_PAPR_SCM BIT(37) #ifndef __ASSEMBLY__ -- 2.17.1