Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ieee1394: skip dummy loop in build_speed_map

The last loop in ieee1394 core's speed calculation is not required
unless ieee1394.h::IEEE1394_SPEED_MAX is changed from its current value
of 3.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>

authored by

Stefan Richter and committed by
Ben Collins
433a87d5 f0cbefe6

+5 -1
+2
drivers/ieee1394/ieee1394.h
··· 77 77 #define SELFID_PORT_NCONN 0x1 78 78 #define SELFID_PORT_NONE 0x0 79 79 80 + #define SELFID_SPEED_UNKNOWN 0x3 /* 1394b PHY */ 81 + 80 82 #define PHYPACKET_LINKON 0x40000000 81 83 #define PHYPACKET_PHYCONFIG_R 0x00800000 82 84 #define PHYPACKET_PHYCONFIG_T 0x00400000
+3 -1
drivers/ieee1394/ieee1394_core.c
··· 355 355 } 356 356 } 357 357 358 + #if SELFID_SPEED_UNKNOWN != IEEE1394_SPEED_MAX 358 359 /* assume maximum speed for 1394b PHYs, nodemgr will correct it */ 359 360 for (n = 0; n < nodecount; n++) 360 - if (speedcap[n] == 3) 361 + if (speedcap[n] == SELFID_SPEED_UNKNOWN) 361 362 speedcap[n] = IEEE1394_SPEED_MAX; 363 + #endif 362 364 } 363 365 364 366