Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107090
b: refs/heads/master
c: fb90490
h: refs/heads/master
v: v3
  • Loading branch information
Brian Cavagnolo authored and John W. Linville committed Jul 29, 2008
1 parent 97676a6 commit 28fbd39
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 699669f331a9e459713e4327a468db8fbb8cd60f
refs/heads/master: fb904907fb1a02a64af9f2d1fb1ef35d963231f9
30 changes: 15 additions & 15 deletions trunk/drivers/net/wireless/libertas/persistcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static ssize_t bootflag_get(struct device *dev,
if (ret)
return ret;

return snprintf(buf, 12, "0x%x\n", le32_to_cpu(defs.bootflag));
return snprintf(buf, 12, "%d\n", le32_to_cpu(defs.bootflag));
}

/**
Expand All @@ -63,8 +63,8 @@ static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,
int ret;

memset(&cmd, 0, sizeof(cmd));
ret = sscanf(buf, "%x", &datum);
if (ret != 1)
ret = sscanf(buf, "%d", &datum);
if ((ret != 1) || (datum > 1))
return -EINVAL;

*((__le32 *)&cmd.data[0]) = cpu_to_le32(!!datum);
Expand All @@ -91,7 +91,7 @@ static ssize_t boottime_get(struct device *dev,
if (ret)
return ret;

return snprintf(buf, 12, "0x%x\n", defs.boottime);
return snprintf(buf, 12, "%d\n", defs.boottime);
}

/**
Expand All @@ -106,8 +106,8 @@ static ssize_t boottime_set(struct device *dev,
int ret;

memset(&cmd, 0, sizeof(cmd));
ret = sscanf(buf, "%x", &datum);
if (ret != 1)
ret = sscanf(buf, "%d", &datum);
if ((ret != 1) || (datum > 255))
return -EINVAL;

/* A too small boot time will result in the device booting into
Expand Down Expand Up @@ -143,7 +143,7 @@ static ssize_t channel_get(struct device *dev,
if (ret)
return ret;

return snprintf(buf, 12, "0x%x\n", le16_to_cpu(defs.channel));
return snprintf(buf, 12, "%d\n", le16_to_cpu(defs.channel));
}

/**
Expand All @@ -154,11 +154,11 @@ static ssize_t channel_set(struct device *dev, struct device_attribute *attr,
{
struct lbs_private *priv = to_net_dev(dev)->priv;
struct cmd_ds_mesh_config cmd;
uint16_t datum;
uint32_t datum;
int ret;

memset(&cmd, 0, sizeof(cmd));
ret = sscanf(buf, "%hx", &datum);
ret = sscanf(buf, "%d", &datum);
if (ret != 1 || datum < 1 || datum > 11)
return -EINVAL;

Expand Down Expand Up @@ -274,8 +274,8 @@ static ssize_t protocol_id_set(struct device *dev,
int ret;

memset(&cmd, 0, sizeof(cmd));
ret = sscanf(buf, "%x", &datum);
if (ret != 1)
ret = sscanf(buf, "%d", &datum);
if ((ret != 1) || (datum > 255))
return -EINVAL;

/* fetch all other Information Element parameters */
Expand Down Expand Up @@ -328,8 +328,8 @@ static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,
int ret;

memset(&cmd, 0, sizeof(cmd));
ret = sscanf(buf, "%x", &datum);
if (ret != 1)
ret = sscanf(buf, "%d", &datum);
if ((ret != 1) || (datum > 255))
return -EINVAL;

/* fetch all other Information Element parameters */
Expand Down Expand Up @@ -382,8 +382,8 @@ static ssize_t capability_set(struct device *dev, struct device_attribute *attr,
int ret;

memset(&cmd, 0, sizeof(cmd));
ret = sscanf(buf, "%x", &datum);
if (ret != 1)
ret = sscanf(buf, "%d", &datum);
if ((ret != 1) || (datum > 255))
return -EINVAL;

/* fetch all other Information Element parameters */
Expand Down

0 comments on commit 28fbd39

Please sign in to comment.