[PATCH 04/19] ieee1394: skip dummy loop in build_speed_map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
---
Index: linux/drivers/ieee1394/ieee1394.h
===================================================================
--- linux.orig/drivers/ieee1394/ieee1394.h	2006-07-02 12:02:06.000000000 +0200
+++ linux/drivers/ieee1394/ieee1394.h	2006-07-02 12:11:23.000000000 +0200
@@ -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: linux/drivers/ieee1394/ieee1394_core.c
===================================================================
--- linux.orig/drivers/ieee1394/ieee1394_core.c	2006-07-02 12:02:04.000000000 +0200
+++ linux/drivers/ieee1394/ieee1394_core.c	2006-07-02 12:11:23.000000000 +0200
@@ -355,10 +355,12 @@ static void build_speed_map(struct hpsb_
 		}
 	}
 
+#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
 }
 
 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux