Re: + s390-add-modalias-to-uevent-for-ccw-devices.patch added to -mm tree

From: Bastian Blank
Date: Mon Mar 06 2006 - 08:48:09 EST


On Mon, Mar 06, 2006 at 11:04:16AM +0100, Cornelia Huck wrote:
> Hm, didn't see this on lkml, but the patch looks fine.

And it does not work as expected. The uevent includes "MODALIAS=" but
the rest got lost in the buffer as it used a wrong offset. The attached
patch makes that really working.

Bastian

--
Lots of people drink from the wrong bottle sometimes.
-- Edith Keeler, "The City on the Edge of Forever",
stardate unknown
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 3494bff..ea4652b 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -79,7 +79,7 @@ ccw_uevent (struct device *dev, char **e
{
struct ccw_device *cdev = to_ccwdev(dev);
int i = 0;
- int length = 0;
+ int length = 0, tmp_length = 0;

if (!cdev)
return -ENODEV;
@@ -120,8 +120,8 @@ ccw_uevent (struct device *dev, char **e
buffer += length;

envp[i++] = buffer;
- length += scnprintf(buffer, buffer_size - length, "MODALIAS=");
- length += modalias_print(cdev, buffer + length, buffer_size - length);
+ length += tmp_length = scnprintf(buffer, buffer_size - length, "MODALIAS=");
+ length += modalias_print(cdev, buffer + tmp_length, buffer_size - length);
if ((buffer_size - length <= 0) || (i >= num_envp))
return -ENOMEM;

Attachment: signature.asc
Description: Digital signature