[PATCH] libertas: 64-bit cleanups
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
c4aa7051b6
commit
4269e2ad83
@@ -277,7 +277,7 @@ static void libertas_parse_ssid(char *buf, size_t count,
|
||||
if (!end)
|
||||
end = buf + count - 1;
|
||||
|
||||
size = min(IW_ESSID_MAX_SIZE, end - hold);
|
||||
size = min((size_t)IW_ESSID_MAX_SIZE, (size_t) (end - hold));
|
||||
strncpy(scan_cfg->specificSSID, hold, size);
|
||||
|
||||
return;
|
||||
@@ -1779,7 +1779,7 @@ void libertas_debugfs_remove_one(wlan_private *priv)
|
||||
struct debug_data {
|
||||
char name[32];
|
||||
u32 size;
|
||||
u32 addr;
|
||||
size_t addr;
|
||||
};
|
||||
|
||||
/* To debug any member of wlan_adapter, simply add one line here.
|
||||
@@ -1826,6 +1826,8 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,
|
||||
val = *((u16 *) d[i].addr);
|
||||
else if (d[i].size == 4)
|
||||
val = *((u32 *) d[i].addr);
|
||||
else if (d[i].size == 8)
|
||||
val = *((u64 *) d[i].addr);
|
||||
|
||||
pos += sprintf(p + pos, "%s=%d\n", d[i].name, val);
|
||||
}
|
||||
@@ -1845,7 +1847,7 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,
|
||||
* @param data data to write
|
||||
* @return number of data
|
||||
*/
|
||||
static int wlan_debugfs_write(struct file *f, const char __user *buf,
|
||||
static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf,
|
||||
size_t cnt, loff_t *ppos)
|
||||
{
|
||||
int r, i;
|
||||
@@ -1887,12 +1889,14 @@ static int wlan_debugfs_write(struct file *f, const char __user *buf,
|
||||
*((u16 *) d[i].addr) = (u16) r;
|
||||
else if (d[i].size == 4)
|
||||
*((u32 *) d[i].addr) = (u32) r;
|
||||
else if (d[i].size == 8)
|
||||
*((u64 *) d[i].addr) = (u64) r;
|
||||
break;
|
||||
} while (1);
|
||||
}
|
||||
kfree(pdata);
|
||||
|
||||
return cnt;
|
||||
return (ssize_t)cnt;
|
||||
}
|
||||
|
||||
static struct file_operations libertas_debug_fops = {
|
||||
@@ -1917,7 +1921,7 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev)
|
||||
return;
|
||||
|
||||
for (i = 0; i < num_of_items; i++)
|
||||
items[i].addr += (u32) priv->adapter;
|
||||
items[i].addr += (size_t) priv->adapter;
|
||||
|
||||
priv->debugfs_debug = debugfs_create_file("debug", 0644,
|
||||
priv->debugfs_dir, &items[0],
|
||||
|
Reference in New Issue
Block a user