Skip to contentSkip to conversation

staging: hp100: line over 80 characters

PATCH Superseded Gokce Kuler 4 participants 4 messages Mar 22, 2020 – Mar 23, 2020 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: hp100: line over 80 characters

Moved to the bottom line after == operator for it exceeds 80 character

---
 drivers/staging/hp/hp100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/hp/hp100.c +2 -1
index 1b957aa..43607fb 100644
@@ -549,7 +549,8 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 #endif
 			local_mode = 3;
 		} else if (chip == HP100_CHIPID_LASSEN &&
-			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) == (HP100_BM_WRITE | HP100_BM_READ)) {
+			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) ==
+			   (HP100_BM_WRITE | HP100_BM_READ)) {
 			/* Conversion to new PCI API :
 			 * I don't have the doc, but I assume that the card
 			 * can map the full 32bit address space.
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 12 lines · Gokce Kuler

Moved to the bottom line after == operator for it exceeds 80 character

---
 drivers/staging/hp/hp100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/hp/hp100.c +0 -0
index 1b957aa..43607fb 100644

drivers/staging/hp/hp100.c static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus, · line 553

Quoted 6 lines
drivers/staging/hp/hp100.c +2 -1
@@ -549,7 +549,8 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 #endif
 			local_mode = 3;
 		} else if (chip == HP100_CHIPID_LASSEN &&
-			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) == (HP100_BM_WRITE | HP100_BM_READ)) {
+			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) ==
+			   (HP100_BM_WRITE | HP100_BM_READ)) {

Needs to be indented one more space, right?

#2 lore raw
In reply to Gokce Kuler
Quoted 12 lines · On Sun, 22 Mar 2020 04:41:37 +0300 Gokce Kuler <[email protected]> wrote:

Moved to the bottom line after == operator for it exceeds 80 character

---
 drivers/staging/hp/hp100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/hp/hp100.c +0 -0
index 1b957aa..43607fb 100644

drivers/staging/hp/hp100.c static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus, · line 553

Quoted 6 lines
drivers/staging/hp/hp100.c +2 -1
@@ -549,7 +549,8 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 #endif
 			local_mode = 3;
 		} else if (chip == HP100_CHIPID_LASSEN &&
-			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) == (HP100_BM_WRITE | HP100_BM_READ)) {
+			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) ==
+			   (HP100_BM_WRITE | HP100_BM_READ)) {

There's another way to fix this:

	a & (x | y) == x | y <=> a & x && a & y 

it should be more readable this way, as it's then immediately clear that those and only those bits need to be set.

Signature · 1 line
Stefano
#3 lore raw
Quoted 23 lines · Stefano Brivio
Quoted 12 lines · On Sun, 22 Mar 2020 04:41:37 +0300 Gokce Kuler <[email protected]> wrote:

Moved to the bottom line after == operator for it exceeds 80 character

---
 drivers/staging/hp/hp100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/hp/hp100.c +0 -0
index 1b957aa..43607fb 100644

drivers/staging/hp/hp100.c static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus, · line 553

Quoted 6 lines
drivers/staging/hp/hp100.c +2 -1
@@ -549,7 +549,8 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 #endif
 			local_mode = 3;
 		} else if (chip == HP100_CHIPID_LASSEN &&
-			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) == (HP100_BM_WRITE | HP100_BM_READ)) {
+			   (lsw & (HP100_BM_WRITE | HP100_BM_READ)) ==
+			   (HP100_BM_WRITE | HP100_BM_READ)) {

There's another way to fix this:

Quoted 4 lines
	a & (x | y) == x | y <=> a & x && a & y

it should be more readable this way, as it's then immediately clear that those and only those bits need to be set.

Maybe with ()s? All those &s looks confusing.

julia