From: Stefan Richter Date: Mon, 3 Jul 2006 16:02:27 +0000 (-0400) Subject: [PATCH] ieee1394: skip dummy loop in build_speed_map X-Git-Tag: v2.6.19-rc1~644^2~46 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=433a87d528f685028b6f61fc3d7fae07ed915aa8;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Ben Collins --- diff --git a/drivers/ieee1394/ieee1394.h b/drivers/ieee1394/ieee1394.h index 936d776de00..d911abe3a35 100644 --- a/drivers/ieee1394/ieee1394.h +++ b/drivers/ieee1394/ieee1394.h @@ -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 diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index f43739c5cab..559c477092f 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c @@ -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 }