Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1096298rwr; Thu, 27 Apr 2023 12:15:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5VZN0n9P9NWdBb5uovzu8bmwf9EKet/OGQ7WWuVfkcFgDkmCWKyAb3hwWEdFoYd1B6ToZ5 X-Received: by 2002:a17:90a:1a01:b0:247:9e56:d895 with SMTP id 1-20020a17090a1a0100b002479e56d895mr2598530pjk.1.1682622915888; Thu, 27 Apr 2023 12:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682622915; cv=none; d=google.com; s=arc-20160816; b=vf8ZFVCi6b0qgGDGuFaA2zSlx5KrnJeY2PITqQXf6L4jyGnMH3D/LAxET/DwWKyjUA 7w7IjcCxrssEorF6d2x3slWt47/obWARad3ZRGnIYU526uPhrQftl8o+te/FdDs3u4n3 dUb36pB4bYKvsmhOHaQTyAW/+uzk96plRZWl41ZdpgjQJA/UXbHe1oYxsPexMjohjnOW jLbrhnzgT3sPo22/US2HFe3TSDfTsYnlecDE3FhE9lvuQ60z1NCpeP7SMUO8bFCNf0Jc KkXPN+qCRHN/uGkN91jwqKjC4+/AWsiL4mPBcVTBPKezYsXd6+ojXdE/iebSYVnMbjqK FgDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zj7TJNoj7iJozy+gfEtjD23GDYfwNpxne9lF2u+D2v0=; b=rXSomVldFtkeq8MKqP5DOJQFm0phJAcax+yof/Kn55gajGcsswURaRJOEJhOSsD8/T 0oK1mA0YfOP69cNJdFX4RU/i4nX0eIRprPSFcyuxCvaGS7PZMyweyL7P/4llAgx0hWlO PZPn0yIB3wI/PE0ePOgjS55M5GmdGpaxw9ke2A3r8bpRDjCNRJSrvFzmVBQZqsWh9XsN 9o8KytIJIleUTZQ0c7UZD4JKTb6sgxrH63lHQN5AX7HZZF3AP/v4Bwm8Hh3+oLJHLiTE 6lLPh3iqhbcEYMOv1IWhjUX8P6cmwNMMSC+pb3ZPp3hmw115EBbXxbFRtv5ggV7JAM+p kfyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fs14-20020a17090af28e00b0024780bdd76dsi275526pjb.130.2023.04.27.12.15.01; Thu, 27 Apr 2023 12:15:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244672AbjD0TH5 (ORCPT + 99 others); Thu, 27 Apr 2023 15:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244593AbjD0THv (ORCPT ); Thu, 27 Apr 2023 15:07:51 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB4FD46B7; Thu, 27 Apr 2023 12:07:43 -0700 (PDT) Received: from ipservice-092-217-081-249.092.217.pools.vodafone-ip.de ([92.217.81.249] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1ps6l6-0003RX-Nc; Thu, 27 Apr 2023 20:54:24 +0200 From: Martin Kaiser To: Herbert Xu Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 3/3] hwrng: imx-rngc - use BIT(x) for register bit defines Date: Thu, 27 Apr 2023 20:53:57 +0200 Message-Id: <20230427185357.923412-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230427185357.923412-1-martin@kaiser.cx> References: <20230427185357.923412-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Rewrite the defines for register bits to use BIT(x) instead of writing out the 32-bit number. This makes it easier to compare the code with the register descriptions in the reference manual. Signed-off-by: Martin Kaiser --- drivers/char/hw_random/imx-rngc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c index 546dc3655e5b..6872d1c0060b 100644 --- a/drivers/char/hw_random/imx-rngc.c +++ b/drivers/char/hw_random/imx-rngc.c @@ -35,19 +35,19 @@ #define RNGC_TYPE_RNGC 0x2 -#define RNGC_CMD_CLR_ERR 0x00000020 -#define RNGC_CMD_CLR_INT 0x00000010 -#define RNGC_CMD_SEED 0x00000002 -#define RNGC_CMD_SELF_TEST 0x00000001 +#define RNGC_CMD_CLR_ERR BIT(5) +#define RNGC_CMD_CLR_INT BIT(4) +#define RNGC_CMD_SEED BIT(1) +#define RNGC_CMD_SELF_TEST BIT(0) -#define RNGC_CTRL_MASK_ERROR 0x00000040 -#define RNGC_CTRL_MASK_DONE 0x00000020 -#define RNGC_CTRL_AUTO_SEED 0x00000010 +#define RNGC_CTRL_MASK_ERROR BIT(6) +#define RNGC_CTRL_MASK_DONE BIT(5) +#define RNGC_CTRL_AUTO_SEED BIT(4) -#define RNGC_STATUS_ERROR 0x00010000 +#define RNGC_STATUS_ERROR BIT(16) #define RNGC_STATUS_FIFO_LEVEL GENMASK(11, 8) -#define RNGC_STATUS_SEED_DONE 0x00000020 -#define RNGC_STATUS_ST_DONE 0x00000010 +#define RNGC_STATUS_SEED_DONE BIT(5) +#define RNGC_STATUS_ST_DONE BIT(4) #define RNGC_ERROR_STATUS_STAT_ERR 0x00000008 -- 2.30.2