Re: [PATCH 2.6.23] ibmebus: Prevent bus_id collisions

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

 



+	len = strlen(dn->full_name + 1);
+	bus_len = min(len, BUS_ID_SIZE - 1);
+	memcpy(dev->ofdev.dev.bus_id, dn->full_name + 1
+	       + (len - bus_len), bus_len);
+	for (i = 0; i < bus_len; i++)
+		if (dev->ofdev.dev.bus_id[i] == '/')
+			dev->ofdev.dev.bus_id[i] = '_';
/* Register with generic device framework. */
 	if (ibmebus_register_device_common(dev, dn->name) != 0) {

What happens when the full name is > 31 characters? It looks to me that it will be truncated, which takes away the uniqueness guarantee.

There must be an individual property that is guaranteed to be unique and less than 32 characters. How about "ibm,my-drc-index"? That looks like a good candidate.
-
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