[PATCH] ieee1394: skip dummy loop in build_speed_map
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Mon, 3 Jul 2006 16:02:27 +0000 (12:02 -0400)
committerBen Collins <bcollins@ubuntu.com>
Mon, 3 Jul 2006 16:02:27 +0000 (12:02 -0400)
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>
drivers/ieee1394/ieee1394.h
drivers/ieee1394/ieee1394_core.c

index 936d776de00a883bdcd0301f7bde5742e64f1384..d911abe3a35e52a21904b7f15ef9837b5739066f 100644 (file)
@@ -77,6 +77,8 @@ extern const char *hpsb_speedto_str[];
 #define SELFID_PORT_NCONN        0x1
 #define SELFID_PORT_NONE         0x0
 
+#define SELFID_SPEED_UNKNOWN           0x3     /* 1394b PHY */
+
 #define PHYPACKET_LINKON                       0x40000000
 #define PHYPACKET_PHYCONFIG_R                  0x00800000
 #define PHYPACKET_PHYCONFIG_T                  0x00400000
index f43739c5cab2ed11176c8493d4cf90de2e9a5f49..559c477092f85a3397091d7808db3769d1b40557 100644 (file)
@@ -355,10 +355,12 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
                }
        }
 
+#if SELFID_SPEED_UNKNOWN != IEEE1394_SPEED_MAX
        /* assume maximum speed for 1394b PHYs, nodemgr will correct it */
        for (n = 0; n < nodecount; n++)
-               if (speedcap[n] == 3)
+               if (speedcap[n] == SELFID_SPEED_UNKNOWN)
                        speedcap[n] = IEEE1394_SPEED_MAX;
+#endif
 }