From patchwork Sun Sep 3 08:56:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 111513 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp174546qge; Sun, 3 Sep 2017 01:57:27 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7DNPgD7dwgi6qwPZfS59ccEa7QRn2LFMO4auAFRso49RjaCaNQbb4NcptZlY+pzt+w2/f6 X-Received: by 10.84.254.74 with SMTP id a10mr8762818pln.52.1504429047253; Sun, 03 Sep 2017 01:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504429047; cv=none; d=google.com; s=arc-20160816; b=hEvnh9367a2L1/HLb+WhKK+IgO2JairP7Fy2gT5UggghoK3eLEc9dfn/n2mkqyK4ut tJ4+1ldFjZ9pjMv1f7PVw7k7l+6Mzn33mRYZ3EINrEEeHzFrJu7KUPYAysgBdm7hswDX P4nor4To56sQJpA5FUjKlv8l6LSwM2e6NIaqn+LR4TON2a9ZUfPCE6m2qD46kV1W0ji+ T2+uZ4BRNnk2m720knkWC7a58C0OIA34edvCIdaj5crpwWPKYu+R0VkJPpKgQ+jWHHEy 33qIi98mjU+7PeylQx4VTC27i1mE41rATVP8+vR2KNHSN3uT00qoSaZdE13i7iJ44HBR BKzw== 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:arc-authentication-results; bh=fwtsk9ntsL2uaf31Vro4gEycuDzb/TJQ/Epr9eZi83o=; b=YGinxx3FS4hZRq6QidtMfRGfXG/YIg/9WyTeQSuRZrz4Udex3tS2XnGo9+aO4nt/pX Caa+z2c5Pje/h4+U+E4YtEKaDuoNOhAVhRALIFPt60P2hL+heGl06qV0krCGUI6V/0K7 SAVMuz0i4uKqxQGOZBg4MzwUDNz4szkXDbn5PYWv5BzQC0fwK4Mj33L4eVLKjdkUU3kP LxJvClZXCOlzqHm4d2fDHI9mNyrbzBDaGmPBLpSgVEUvLnmMBy3+L+z7hTLLkYRBH7m3 1sM2N73Q+9eg1FqEATJvxivhY9GDGQd1O1zxVr/p7TpV/5+bpUm3Mxk/Cx3VmQ2ljPb0 2bJA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si3391975pll.210.2017.09.03.01.57.26; Sun, 03 Sep 2017 01:57: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; 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 S1752917AbdICI5Y (ORCPT + 26 others); Sun, 3 Sep 2017 04:57:24 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49150 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752898AbdICI5T (ORCPT ); Sun, 3 Sep 2017 04:57:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 48C412B; Sun, 3 Sep 2017 01:57:19 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A03D3F483; Sun, 3 Sep 2017 01:57:16 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 6/8] staging: ccree: move over to BIT macro for bit defines Date: Sun, 3 Sep 2017 11:56:48 +0300 Message-Id: <1504429011-25514-7-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1504429011-25514-1-git-send-email-gilad@benyossef.com> References: <1504429011-25514-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use BIT macro for bit definitions where needed. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.h | 10 +++++----- drivers/staging/ccree/ssi_driver.c | 3 ++- drivers/staging/ccree/ssi_driver.h | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_cipher.h b/drivers/staging/ccree/ssi_cipher.h index 296b375..c9a83df 100644 --- a/drivers/staging/ccree/ssi_cipher.h +++ b/drivers/staging/ccree/ssi_cipher.h @@ -27,11 +27,11 @@ #include "ssi_buffer_mgr.h" /* Crypto cipher flags */ -#define CC_CRYPTO_CIPHER_KEY_KFDE0 (1 << 0) -#define CC_CRYPTO_CIPHER_KEY_KFDE1 (1 << 1) -#define CC_CRYPTO_CIPHER_KEY_KFDE2 (1 << 2) -#define CC_CRYPTO_CIPHER_KEY_KFDE3 (1 << 3) -#define CC_CRYPTO_CIPHER_DU_SIZE_512B (1 << 4) +#define CC_CRYPTO_CIPHER_KEY_KFDE0 BIT(0) +#define CC_CRYPTO_CIPHER_KEY_KFDE1 BIT(1) +#define CC_CRYPTO_CIPHER_KEY_KFDE2 BIT(2) +#define CC_CRYPTO_CIPHER_KEY_KFDE3 BIT(3) +#define CC_CRYPTO_CIPHER_DU_SIZE_512B BIT(4) #define CC_CRYPTO_CIPHER_KEY_KFDE_MASK (CC_CRYPTO_CIPHER_KEY_KFDE0 | CC_CRYPTO_CIPHER_KEY_KFDE1 | CC_CRYPTO_CIPHER_KEY_KFDE2 | CC_CRYPTO_CIPHER_KEY_KFDE3) diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c index 8f1d7af..6d16220 100644 --- a/drivers/staging/ccree/ssi_driver.c +++ b/drivers/staging/ccree/ssi_driver.c @@ -185,7 +185,8 @@ int init_cc_regs(struct ssi_drvdata *drvdata, bool is_probe) CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_ICR), val); /* Unmask relevant interrupt cause */ - val = (~(SSI_COMP_IRQ_MASK | SSI_AXI_ERR_IRQ_MASK | SSI_GPR0_IRQ_MASK)); + val = (unsigned int)(~(SSI_COMP_IRQ_MASK | SSI_AXI_ERR_IRQ_MASK | + SSI_GPR0_IRQ_MASK)); CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_IMR), val); #ifdef DX_HOST_IRQ_TIMER_INIT_VAL_REG_OFFSET diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h index 9b6476d..06a3c48 100644 --- a/drivers/staging/ccree/ssi_driver.h +++ b/drivers/staging/ccree/ssi_driver.h @@ -68,12 +68,12 @@ #define SSI_AXI_IRQ_MASK ((1 << DX_AXIM_CFG_BRESPMASK_BIT_SHIFT) | (1 << DX_AXIM_CFG_RRESPMASK_BIT_SHIFT) | \ (1 << DX_AXIM_CFG_INFLTMASK_BIT_SHIFT) | (1 << DX_AXIM_CFG_COMPMASK_BIT_SHIFT)) -#define SSI_AXI_ERR_IRQ_MASK (1 << DX_HOST_IRR_AXI_ERR_INT_BIT_SHIFT) +#define SSI_AXI_ERR_IRQ_MASK BIT(DX_HOST_IRR_AXI_ERR_INT_BIT_SHIFT) -#define SSI_COMP_IRQ_MASK (1 << DX_HOST_IRR_AXIM_COMP_INT_BIT_SHIFT) +#define SSI_COMP_IRQ_MASK BIT(DX_HOST_IRR_AXIM_COMP_INT_BIT_SHIFT) /* TEE FIPS status interrupt */ -#define SSI_GPR0_IRQ_MASK (1 << DX_HOST_IRR_GPR0_BIT_SHIFT) +#define SSI_GPR0_IRQ_MASK BIT(DX_HOST_IRR_GPR0_BIT_SHIFT) #define SSI_CRA_PRIO 3000