Missing break in timedia serial setup.
Spotted during code review by a Fedora user.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174967
drivers/serial/8250_pci.c renamed from drivers/serial/8250_pci.c~ +1 -0
@@ -517,6 +517,7 @@ pci_timedia_setup(struct serial_privatecase 3 : offset = board->uart_offset; bar =1 ; +break ;case 4 :/* BAR 2 */ case 5 :/* BAR 3 */ case 6 :/* BAR 4 */
Quoted 2 lines · Dave Jones
Spotted during code review by a Fedora user.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174967
Makes no difference.
switch (idx) {
case 3:
bar = 1;
case 4: /* BAR 2 */
case 5: /* BAR 3 */
case 6: /* BAR 4 */
case 7: /* BAR 5 */
bar = idx - 2;If idx is 3, idx - 2 is 1. So the bar = 1 is actually redundant in case 3.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Quoted 15 lines · Russell King
Quoted 2 lines · Dave Jones
Spotted during code review by a Fedora user.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174967Makes no difference.
switch (idx) { case 3: bar = 1; case 4: /* BAR 2 */ case 5: /* BAR 3 */ case 6: /* BAR 4 */ case 7: /* BAR 5 */ bar = idx - 2;
Quoted 2 lines
If idx is 3, idx - 2 is 1. So the bar = 1 is actually redundant in case 3.
Duh, yes of course. Here's a patch to remove the redundant assignment, but as it's harmless, I'll leave it up to you to decide whether or not it's worth applying.
drivers/serial/8250_pci.c renamed from drivers/serial/8250_pci.c~ +0 -1
@@ -516,7 +516,6 @@ pci_timedia_setup(struct serial_privatebreak ;case 3 : offset = board->uart_offset; - bar =1 ;case 4 :/* BAR 2 */ case 5 :/* BAR 3 */ case 6 :/* BAR 4 */
Quoted 7 lines
Signed-off-by Dave Jones <[email protected]>
drivers/serial/8250_pci.c pci_timedia_setup(struct serial_private
Quoted 8 lines
drivers/serial/8250_pci.c renamed from drivers/serial/8250_pci.c~ +0
-2@@ -516,7 +516,6 @@ pci_timedia_setup(struct serial_privatebreak ;case 3 : offset = board->uart_offset; - bar =1 ;case 4 :/* BAR 2 */ case 5 :/* BAR 3 */ case 6 :/* BAR 4 */ -
might as well add a /* fall through */ comment so that this doesn't come up again in the future..
Quoted 2 lines · Arjan van de Ven
might as well add a /* fall through */ comment so that this doesn't come up again in the future..
Remove redundant assignment, and mark fallthrough.
drivers/serial/8250_pci.c renamed from drivers/serial/8250_pci.c~ +1 -1
@@ -516,7 +516,7 @@ pci_timedia_setup(struct serial_privatebreak ;case 3 : offset = board->uart_offset; - bar =1 ; +/* FALLTHROUGH */ case 4 :/* BAR 2 */ case 5 :/* BAR 3 */ case 6 :/* BAR 4 */
Quoted 6 lines · Dave Jones
Quoted 2 lines · Arjan van de Ven
might as well add a /* fall through */ comment so that this doesn't come up again in the future..
Remove redundant assignment, and mark fallthrough.
Thanks Dave, committed.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core