linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cleanup: remove redundant code from callers of sysfs_get_attr_value()
@ 2008-09-04 14:20 Alan Jenkins
  2008-09-08 20:06 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Jenkins @ 2008-09-04 14:20 UTC (permalink / raw)
  To: linux-hotplug

* duplicate strlcpy in udev_rules_apply_format()

* "remove trailing newlines" in udevinfo, when sysfs_attr_get_value()
  does that already.

diff --git a/udev/udev_rules.c b/udev/udev_rules.c
index 4719cab..f7acd9c 100644
--- a/udev/udev_rules.c
+++ b/udev/udev_rules.c
@@ -850,10 +850,8 @@ found:
 					do {
 						dbg("looking at '%s'\n", dev_parent->devpath);
 						value = sysfs_attr_get_value(dev_parent->devpath, attr);
-						if (value != NULL) {
-							strlcpy(temp2, value, sizeof(temp2));
+						if (value != NULL)
 							break;
-						}
 						dev_parent = sysfs_device_get_parent(dev_parent);
 					} while (dev_parent != NULL);
 				}
diff --git a/udev/udevinfo.c b/udev/udevinfo.c
index 738ffc6..9b75364 100644
--- a/udev/udevinfo.c
+++ b/udev/udevinfo.c
@@ -75,10 +75,6 @@ static void print_all_attributes(const char *devpath, const char *key)
 				len = sizeof(value) - 1;
 			dbg("attr '%s'='%s'(%zi)\n", dent->d_name, value, len);
 
-			/* remove trailing newlines */
-			while (len && value[len-1] = '\n')
-				value[--len] = '\0';
-
 			/* skip nonprintable attributes */
 			while (len && isprint(value[len-1]))
 				len--;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] cleanup: remove redundant code from callers of sysfs_get_attr_value()
  2008-09-04 14:20 [PATCH 1/3] cleanup: remove redundant code from callers of sysfs_get_attr_value() Alan Jenkins
@ 2008-09-08 20:06 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2008-09-08 20:06 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Sep 4, 2008 at 16:20, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
> * duplicate strlcpy in udev_rules_apply_format()
>
> * "remove trailing newlines" in udevinfo, when sysfs_attr_get_value()
>  does that already.

Applied.

Thanks,
Kay

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-08 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04 14:20 [PATCH 1/3] cleanup: remove redundant code from callers of sysfs_get_attr_value() Alan Jenkins
2008-09-08 20:06 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).