summaryrefslogtreecommitdiff
path: root/linux/dev
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2010-09-19 23:08:57 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-09-19 23:08:57 +0200
commit45fcd2d09c15820e58e2334b80f7367d2f98ebb7 (patch)
tree4cd5d2e64675bd9257074b0fbe0b683036067e13 /linux/dev
parenta8d8bf8488fc7a04523f3c92834a60672098ceca (diff)
Fix device_get/set_status ABI for NET_FLAGS
* linux/dev/glue/net.c (device_get_status): Compare count with 1 instead of sizeof(short). Access *status instead of *(short *) status. (device_set_status): Likewise.
Diffstat (limited to 'linux/dev')
-rw-r--r--linux/dev/glue/net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/dev/glue/net.c b/linux/dev/glue/net.c
index 20ce754..095428d 100644
--- a/linux/dev/glue/net.c
+++ b/linux/dev/glue/net.c
@@ -537,10 +537,10 @@ device_get_status (void *d, dev_flavor_t flavor, dev_status_t status,
{
struct net_data *net = (struct net_data *) d;
- if (*count != sizeof(short))
+ if (*count != 1)
return D_INVALID_SIZE;
- *(short *) status = net->dev->flags;
+ status[0] = net->dev->flags;
return D_SUCCESS;
}
@@ -605,10 +605,10 @@ device_set_status(void *d, dev_flavor_t flavor, dev_status_t status,
{
if (flavor == NET_FLAGS)
{
- if (count != sizeof(short))
+ if (count != 1)
return D_INVALID_SIZE;
- short flags = *(short *) status;
+ short flags = status[0];
struct net_data *net = (struct net_data *) d;
dev_change_flags (net->dev, flags);