Re: [PATCH, RFC 2/3] Use sem_getcount in ieee1394

From: Jody McIntyre
Date: Thu Mar 10 2005 - 19:21:41 EST



Convert 1394's node manager to use sem_getcount instead of nasty hack.
Tested on parisc (where it eliminates a warning), ia64, i386.

Signed-off-by: Jody McIntyre <scjody@xxxxxxxxxxxxxx>

Index: 1394-dev/drivers/ieee1394/nodemgr.c
===================================================================
--- 1394-dev.orig/drivers/ieee1394/nodemgr.c 2005-03-08 16:50:40.000000000 -0500
+++ 1394-dev/drivers/ieee1394/nodemgr.c 2005-03-08 16:51:07.000000000 -0500
@@ -284,7 +284,7 @@ static DEVICE_ATTR(bus_options,S_IRUGO,f
static ssize_t fw_show_ne_tlabels_free(struct device *dev, char *buf)
{
struct node_entry *ne = container_of(dev, struct node_entry, device);
- return sprintf(buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1);
+ return sprintf(buf, "%d\n", sem_getcount(&ne->tpool->count) + 1);
}
static DEVICE_ATTR(tlabels_free,S_IRUGO,fw_show_ne_tlabels_free,NULL);

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