Skip to contentSkip to conversation

ohci-tmio.c : missing 'break' statements

PATCH In review Ameen Ali 2 participants 2 messages Feb 25, 2015

Subsystems (2)
lore
Share & tools
lore

Ameen Ali

author
#0 lore raw

PATCH 5/5 ohci-tmio.c : missing 'break' statements

Redundant bitwise operation on 'pm' in 'switch' statement.

---
 drivers/usb/host/ohci-tmio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ohci-tmio.c +3 -0
index e9a6eec..c580615 100644
@@ -102,10 +102,13 @@ static void tmio_stop_hc(struct platform_device *dev)
 			dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports);
 		case 3:
 			pm |= CCR_PM_USBPW3;
+			break;
 		case 2:
 			pm |= CCR_PM_USBPW2;
+			break;
 		case 1:
 			pm |= CCR_PM_USBPW1;
+			break;
 	}
 	tmio_iowrite8(0, tmio->ccr + CCR_INTC);
 	tmio_iowrite8(0, tmio->ccr + CCR_ILME);
Signature · 1 line
2.1.0
maintainer
#1 lore raw

The "break" statements are missing by intention.

Quoted 1 line · Ameen Ali

Redundant bitwise operation on 'pm' in 'switch' statement.

Why do you say the operations are redundant?

Quoted 13 lines
---
 drivers/usb/host/ohci-tmio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ohci-tmio.c +0 -0
index e9a6eec..c580615 100644
@@ -102,10 +102,13 @@ static void tmio_stop_hc(struct platform_device *dev)
 			dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports);
 		case 3:
 			pm |= CCR_PM_USBPW3;

drivers/usb/host/ohci-tmio.c static void tmio_stop_hc(struct platform_device *dev) · line 114

Quoted 10 lines
drivers/usb/host/ohci-tmio.c +3 -0
+			break;
 		case 2:
 			pm |= CCR_PM_USBPW2;
+			break;
 		case 1:
 			pm |= CCR_PM_USBPW1;
+			break;
 	}
 	tmio_iowrite8(0, tmio->ccr + CCR_INTC);
 	tmio_iowrite8(0, tmio->ccr + CCR_ILME);

This patch is wrong. Figuring out why is left as an exercise.

Alan Stern