From patchwork Sun Sep 3 14:57:41 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: 111526 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp454782qge; Sun, 3 Sep 2017 07:58:56 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4K84hSavhoDN12qwXVzD9QpwPXgZXc8vCrUxRj+1XGynb4WtEt6sqS9PNAXvGWwasD8BHF X-Received: by 10.99.186.91 with SMTP id l27mr4631639pgu.426.1504450736008; Sun, 03 Sep 2017 07:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504450735; cv=none; d=google.com; s=arc-20160816; b=xCeeh8RfpUF/EeI6+oZrjbWt5eDa3hOAB6PYTdIFHu06ejaI0FCvym5qFeYt291EYF Pj4UIq9cspH0E3qRVudeVsFo/9zBGk8YTKKqGqTEZ9C9CeW2tm8YLaIUieEIsLuPRyma jt6ov5yGXSJwS3YPvwiCbbvqUkdRPYoHgnIoXU8gUf5IJvEx+Kr8uh/wRdPbZ85Lhrls Rw6hltqDXSytDgDAHEfMow8szRpckigCWoEnO4V98yhN68ZyGq6OsRbwYayAYt0i3Wqq tb3ED3KsKREMg+nPa+YBV1mZvEAQZSe8nlYD9LTD5E3vrVAZt5O0fGWt6ZnbJv36D264 xlBg== 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=EktAq1wTdACkJ78hU0XJBrDmcK8mRDt0Inm8fWh1K4Y3exChrNf4LNWNkBOIvsfyyF ttm4Fh1Imrpymc3igNYf2XIslegvvutmJydmMmm7vtSw9kq/Fy9g1/62IZHatku5ecsK hNo3gngCJEIOF68sAgJJhK37Q2LqfZAER0UTIcfw11UTf8gL3uoHeXWt/9roVSa8r2ye ugufuaM1lsR8sIJ1s5L70Ztp4Dohk8gYqNZxHhvrpQPdYCzDErwljWvOnD0nPsPiZCl5 v/QMLJ44c/4GssNrFLT8ql/qxohcyT+mrKtu2phMfmErvHoq7+oYk+aoprEpTcPlUTfk P/Gg== 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 h4si3755320plk.745.2017.09.03.07.58.55; Sun, 03 Sep 2017 07:58:55 -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 S1753292AbdICO6x (ORCPT + 26 others); Sun, 3 Sep 2017 10:58:53 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50900 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753241AbdICO6N (ORCPT ); Sun, 3 Sep 2017 10:58:13 -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 E74F480D; Sun, 3 Sep 2017 07:58:12 -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 C97283F3E1; Sun, 3 Sep 2017 07:58:10 -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 v2 6/8] staging: ccree: move over to BIT macro for bit defines Date: Sun, 3 Sep 2017 17:57:41 +0300 Message-Id: <1504450664-28252-7-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1504450664-28252-1-git-send-email-gilad@benyossef.com> References: <1504450664-28252-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