public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jagan Teki <jteki@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] sf: Use BIT macro
Date: Mon, 14 Dec 2015 22:33:53 +0530	[thread overview]
Message-ID: <1450112634-6538-2-git-send-email-jteki@openedev.com> (raw)
In-Reply-To: <1450112634-6538-1-git-send-email-jteki@openedev.com>

Used BIT macro like 1 << nr as BIT(nr) where nr is 0...n

Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
 drivers/mtd/spi/sf_internal.h | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 0fa3abb..561abc3 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -16,18 +16,18 @@
 /* Dual SPI flash memories - see SPI_COMM_DUAL_... */
 enum spi_dual_flash {
 	SF_SINGLE_FLASH	= 0,
-	SF_DUAL_STACKED_FLASH	= 1 << 0,
-	SF_DUAL_PARALLEL_FLASH	= 1 << 1,
+	SF_DUAL_STACKED_FLASH	= BIT(0),
+	SF_DUAL_PARALLEL_FLASH	= BIT(1),
 };
 
 /* Enum list - Full read commands */
 enum spi_read_cmds {
-	ARRAY_SLOW		= 1 << 0,
-	ARRAY_FAST		= 1 << 1,
-	DUAL_OUTPUT_FAST	= 1 << 2,
-	DUAL_IO_FAST		= 1 << 3,
-	QUAD_OUTPUT_FAST	= 1 << 4,
-	QUAD_IO_FAST		= 1 << 5,
+	ARRAY_SLOW		= BIT(0),
+	ARRAY_FAST		= BIT(1),
+	DUAL_OUTPUT_FAST	= BIT(2),
+	DUAL_IO_FAST		= BIT(3),
+	QUAD_OUTPUT_FAST	= BIT(4),
+	QUAD_IO_FAST		= BIT(5),
 };
 
 /* Normal - Extended - Full command set */
@@ -37,20 +37,20 @@ enum spi_read_cmds {
 
 /* sf param flags */
 enum {
-#ifdef CONFIG_SPI_FLASH_USE_4K_SECTORS
-	SECT_4K		= 1 << 0,
+#ifndef CONFIG_SPI_FLASH_USE_4K_SECTORS
+	SECT_4K		= 0,
 #else
-	SECT_4K		= 0 << 0,
+	SECT_4K		= BIT(0),
 #endif
-	SECT_32K	= 1 << 1,
-	E_FSR		= 1 << 2,
-	SST_WR		= 1 << 3,
-	WR_QPP		= 1 << 4,
+	SECT_32K	= BIT(1),
+	E_FSR		= BIT(2),
+	SST_WR		= BIT(3),
+	WR_QPP		= BIT(4),
 };
 
 enum spi_nor_option_flags {
-	SNOR_F_SST_WR		= (1 << 0),
-	SNOR_F_USE_FSR		= (1 << 1),
+	SNOR_F_SST_WR		= BIT(0),
+	SNOR_F_USE_FSR		= BIT(1),
 };
 
 #define SPI_FLASH_3B_ADDR_LEN		3
@@ -100,10 +100,10 @@ enum spi_nor_option_flags {
 #endif
 
 /* Common status */
-#define STATUS_WIP			(1 << 0)
-#define STATUS_QEB_WINSPAN		(1 << 1)
-#define STATUS_QEB_MXIC			(1 << 6)
-#define STATUS_PEC			(1 << 7)
+#define STATUS_WIP			BIT(0)
+#define STATUS_QEB_WINSPAN		BIT(1)
+#define STATUS_QEB_MXIC			BIT(6)
+#define STATUS_PEC			BIT(7)
 #define SR_BP0				BIT(2)  /* Block protect 0 */
 #define SR_BP1				BIT(3)  /* Block protect 1 */
 #define SR_BP2				BIT(4)  /* Block protect 2 */
-- 
1.9.1

  reply	other threads:[~2015-12-14 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 17:03 [U-Boot] [PATCH 1/3] sf: Minor cleanup Jagan Teki
2015-12-14 17:03 ` Jagan Teki [this message]
2015-12-15  4:18   ` [U-Boot] [PATCH 2/3] sf: Use BIT macro Bin Meng
2015-12-15  6:23     ` Jagan Teki
2015-12-14 17:03 ` [U-Boot] [PATCH 3/3] sf: Fix quad bit set for micron devices Jagan Teki
2015-12-15  4:18 ` [U-Boot] [PATCH 1/3] sf: Minor cleanup Bin Meng
2015-12-15  6:27   ` Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450112634-6538-2-git-send-email-jteki@openedev.com \
    --to=jteki@openedev.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox