Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1470106

[PATCH v2 2/5] hwrng: amd: use the BIT macro

From LABBE Corentin <clabbe.montjoie@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 2/5] hwrng: amd: use the BIT macro
Date 2016-08-25 14:20 +0200
Message-ID <sa1Nv-PS-11@gated-at.bofh.it> (permalink)
References <sa1Nv-PS-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch add usage of the BIT() macro

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 drivers/char/hw_random/amd-rng.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c
index 45b7965..d0042f5 100644
--- a/drivers/char/hw_random/amd-rng.c
+++ b/drivers/char/hw_random/amd-rng.c
@@ -78,11 +78,11 @@ static int amd_rng_init(struct hwrng *rng)
 	u8 rnen;
 
 	pci_read_config_byte(amd_pdev, 0x40, &rnen);
-	rnen |= (1 << 7);	/* RNG on */
+	rnen |= BIT(7);	/* RNG on */
 	pci_write_config_byte(amd_pdev, 0x40, rnen);
 
 	pci_read_config_byte(amd_pdev, 0x41, &rnen);
-	rnen |= (1 << 7);	/* PMIO enable */
+	rnen |= BIT(7);	/* PMIO enable */
 	pci_write_config_byte(amd_pdev, 0x41, rnen);
 
 	return 0;
@@ -93,7 +93,7 @@ static void amd_rng_cleanup(struct hwrng *rng)
 	u8 rnen;
 
 	pci_read_config_byte(amd_pdev, 0x40, &rnen);
-	rnen &= ~(1 << 7);	/* RNG off */
+	rnen &= ~BIT(7);	/* RNG off */
 	pci_write_config_byte(amd_pdev, 0x40, rnen);
 }
 
-- 
2.7.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] hwrng: amd: rework of the amd hwrng driver LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-25 14:20 +0200
  [PATCH v2 3/5] hwrng: amd: Be consitent with the driver name LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-25 14:20 +0200
  [PATCH v2 1/5] hwrng: amd: Fix style problem with blank line LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-25 14:20 +0200
  [PATCH v2 2/5] hwrng: amd: use the BIT macro LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-25 14:20 +0200
  [PATCH v2 4/5] hwrng: amd: Remove asm/io.h LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-25 14:20 +0200
  [PATCH v2 5/5] hwrng: amd: Rework of the amd768-hwrng driver LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-25 14:20 +0200
    Re: [PATCH v2 5/5] hwrng: amd: Rework of the amd768-hwrng driver Jason Cooper <jason@lakedaemon.net> - 2016-08-25 17:00 +0200
      Re: [PATCH v2 5/5] hwrng: amd: Rework of the amd768-hwrng driver LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-26 10:40 +0200
        Re: [PATCH v2 5/5] hwrng: amd: Rework of the amd768-hwrng driver Jason Cooper <jason@lakedaemon.net> - 2016-08-26 15:40 +0200

csiph-web