From: Parker Newman <parker@finest.io>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: Parker Newman <pnewman@connecttech.com>
Subject: [PATCH v3 2/5] misc: eeprom: eeprom_93cx6: Switch to BIT() macro
Date: Wed, 2 Oct 2024 10:14:08 -0400 [thread overview]
Message-ID: <8fd3f721e7d4dcab4dd2ed1befda40e25a772f69.1727873292.git.pnewman@connecttech.com> (raw)
In-Reply-To: <cover.1727873292.git.pnewman@connecttech.com>
From: Parker Newman <pnewman@connecttech.com>
Use the BIT() macro rather than (1 << (i - 1)).
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Parker Newman <pnewman@connecttech.com>
---
drivers/misc/eeprom/eeprom_93cx6.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/eeprom/eeprom_93cx6.c b/drivers/misc/eeprom/eeprom_93cx6.c
index 4c9827fe9217..e6f0e0fc1ca2 100644
--- a/drivers/misc/eeprom/eeprom_93cx6.c
+++ b/drivers/misc/eeprom/eeprom_93cx6.c
@@ -8,6 +8,7 @@
* Supported chipsets: 93c46 & 93c66.
*/
+#include <linux/bits.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
@@ -102,7 +103,7 @@ static void eeprom_93cx6_write_bits(struct eeprom_93cx6 *eeprom,
/*
* Check if this bit needs to be set.
*/
- eeprom->reg_data_in = !!(data & (1 << (i - 1)));
+ eeprom->reg_data_in = !!(data & BIT(i - 1));
/*
* Write the bit to the eeprom register.
@@ -152,7 +153,7 @@ static void eeprom_93cx6_read_bits(struct eeprom_93cx6 *eeprom,
* Read if the bit has been set.
*/
if (eeprom->reg_data_out)
- buf |= (1 << (i - 1));
+ buf |= BIT(i - 1);
eeprom_93cx6_pulse_low(eeprom);
}
--
2.46.0
next prev parent reply other threads:[~2024-10-02 14:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 14:14 [PATCH v3 0/5] serial: 8250_exar: Replace custom EEPROM code with eeprom_93cx6 Parker Newman
2024-10-02 14:14 ` [PATCH v3 1/5] misc: eeprom: eeprom_93cx6: Add quirk for extra read clock cycle Parker Newman
2024-10-02 14:27 ` Andy Shevchenko
2024-10-02 14:14 ` Parker Newman [this message]
2024-10-02 14:14 ` [PATCH v3 3/5] serial: 8250_exar: Replace custom EEPROM read with eeprom_93cx6 Parker Newman
2024-10-02 14:14 ` [PATCH v3 4/5] serial: 8250_exar: Remove old exar_ee_read() and other unneeded code Parker Newman
2024-10-02 14:29 ` Andy Shevchenko
2024-10-02 14:14 ` [PATCH v3 5/5] serial: 8250_exar: Group CTI EEPROM offsets by device Parker Newman
2024-10-02 14:31 ` [PATCH v3 0/5] serial: 8250_exar: Replace custom EEPROM code with eeprom_93cx6 Andy Shevchenko
2024-10-02 14:37 ` Parker Newman
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=8fd3f721e7d4dcab4dd2ed1befda40e25a772f69.1727873292.git.pnewman@connecttech.com \
--to=parker@finest.io \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=pnewman@connecttech.com \
/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
all inboxes | Powered by JetHome®