Skip to contentSkip to conversation

icom: bit and/or confusion?

PATCH In review Roel Kluin 2 participants 3 messages Aug 14, 2009

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 icom: bit and/or confusion?

Previously, if any bit other than CMD_SND_BREAK was set, CMD_SND_BREAK was not unset.

---
I think meant was: If CMD_SND_BREAK is set, unset it. Correct?

// vi drivers/serial/icom.h +137
#define CMD_SND_BREAK 0x04

drivers/serial/icom.c +1 -1
index cd1b6a4..060f4e3 100644
@@ -617,7 +617,7 @@ static void shutdown(struct icom_port *icom_port)
 	 * disable break condition
 	 */
 	cmdReg = readb(&icom_port->dram->CmdReg);
-	if ((cmdReg | CMD_SND_BREAK) == CMD_SND_BREAK) {
+	if (cmdReg & CMD_SND_BREAK) {
 		writeb(cmdReg & ~CMD_SND_BREAK, &icom_port->dram->CmdReg);
 	}
 }
#1 lore raw
Quoted 15 lines · Roel Kluin

Previously, if any bit other than CMD_SND_BREAK was set, CMD_SND_BREAK was not unset.

---
I think meant was: If CMD_SND_BREAK is set, unset it. Correct?

// vi drivers/serial/icom.h +137
#define CMD_SND_BREAK 0x04

drivers/serial/icom.c +0 -0
index cd1b6a4..060f4e3 100644

drivers/serial/icom.c static void shutdown(struct icom_port *icom_port) · line 620

Quoted 5 lines
drivers/serial/icom.c +1 -1
@@ -617,7 +617,7 @@ static void shutdown(struct icom_port *icom_port)
 	 * disable break condition
 	 */
 	cmdReg = readb(&icom_port->dram->CmdReg);
-	if ((cmdReg | CMD_SND_BREAK) == CMD_SND_BREAK) {
+	if (cmdReg & CMD_SND_BREAK) {

This change is the exact same thing, right? How is the original incorrect here?

thanks,

greg k-h

#2 lore raw
In reply to Roel Kluin
Quoted 15 lines · Roel Kluin

Previously, if any bit other than CMD_SND_BREAK was set, CMD_SND_BREAK was not unset.

---
I think meant was: If CMD_SND_BREAK is set, unset it. Correct?

// vi drivers/serial/icom.h +137
#define CMD_SND_BREAK 0x04

drivers/serial/icom.c +0 -0
index cd1b6a4..060f4e3 100644

drivers/serial/icom.c static void shutdown(struct icom_port *icom_port) · line 620

Quoted 5 lines
drivers/serial/icom.c +1 -1
@@ -617,7 +617,7 @@ static void shutdown(struct icom_port *icom_port)
 	 * disable break condition
 	 */
 	cmdReg = readb(&icom_port->dram->CmdReg);
-	if ((cmdReg | CMD_SND_BREAK) == CMD_SND_BREAK) {
+	if (cmdReg & CMD_SND_BREAK) {

Nevermind, Alan rightly pointed out that I was completly wrong, I'll go queue this up.

thanks,

greg k-h