aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/debugfs.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-05-10 23:10:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-05-11 14:54:55 -0400
commit4269e2ad83036e1d8c076b1f1348f879a93be008 (patch)
tree89a756d40a3e605abfbb7fc8fb1f02b8c2705518 /drivers/net/wireless/libertas/debugfs.c
parentc4aa7051b6d5697d2c0c169153e727c2e4175c5b (diff)
[PATCH] libertas: 64-bit cleanups
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/debugfs.c')
-rw-r--r--drivers/net/wireless/libertas/debugfs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 61cbd47109e4..7d7bc5e86a56 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -277,7 +277,7 @@ static void libertas_parse_ssid(char *buf, size_t count,
277 if (!end) 277 if (!end)
278 end = buf + count - 1; 278 end = buf + count - 1;
279 279
280 size = min(IW_ESSID_MAX_SIZE, end - hold); 280 size = min((size_t)IW_ESSID_MAX_SIZE, (size_t) (end - hold));
281 strncpy(scan_cfg->specificSSID, hold, size); 281 strncpy(scan_cfg->specificSSID, hold, size);
282 282
283 return; 283 return;
@@ -1779,7 +1779,7 @@ void libertas_debugfs_remove_one(wlan_private *priv)
1779struct debug_data { 1779struct debug_data {
1780 char name[32]; 1780 char name[32];
1781 u32 size; 1781 u32 size;
1782 u32 addr; 1782 size_t addr;
1783}; 1783};
1784 1784
1785/* To debug any member of wlan_adapter, simply add one line here. 1785/* 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,
1826 val = *((u16 *) d[i].addr); 1826 val = *((u16 *) d[i].addr);
1827 else if (d[i].size == 4) 1827 else if (d[i].size == 4)
1828 val = *((u32 *) d[i].addr); 1828 val = *((u32 *) d[i].addr);
1829 else if (d[i].size == 8)
1830 val = *((u64 *) d[i].addr);
1829 1831
1830 pos += sprintf(p + pos, "%s=%d\n", d[i].name, val); 1832 pos += sprintf(p + pos, "%s=%d\n", d[i].name, val);
1831 } 1833 }
@@ -1845,7 +1847,7 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,
1845 * @param data data to write 1847 * @param data data to write
1846 * @return number of data 1848 * @return number of data
1847 */ 1849 */
1848static int wlan_debugfs_write(struct file *f, const char __user *buf, 1850static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf,
1849 size_t cnt, loff_t *ppos) 1851 size_t cnt, loff_t *ppos)
1850{ 1852{
1851 int r, i; 1853 int r, i;
@@ -1887,12 +1889,14 @@ static int wlan_debugfs_write(struct file *f, const char __user *buf,
1887 *((u16 *) d[i].addr) = (u16) r; 1889 *((u16 *) d[i].addr) = (u16) r;
1888 else if (d[i].size == 4) 1890 else if (d[i].size == 4)
1889 *((u32 *) d[i].addr) = (u32) r; 1891 *((u32 *) d[i].addr) = (u32) r;
1892 else if (d[i].size == 8)
1893 *((u64 *) d[i].addr) = (u64) r;
1890 break; 1894 break;
1891 } while (1); 1895 } while (1);
1892 } 1896 }
1893 kfree(pdata); 1897 kfree(pdata);
1894 1898
1895 return cnt; 1899 return (ssize_t)cnt;
1896} 1900}
1897 1901
1898static struct file_operations libertas_debug_fops = { 1902static struct file_operations libertas_debug_fops = {
@@ -1917,7 +1921,7 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev)
1917 return; 1921 return;
1918 1922
1919 for (i = 0; i < num_of_items; i++) 1923 for (i = 0; i < num_of_items; i++)
1920 items[i].addr += (u32) priv->adapter; 1924 items[i].addr += (size_t) priv->adapter;
1921 1925
1922 priv->debugfs_debug = debugfs_create_file("debug", 0644, 1926 priv->debugfs_debug = debugfs_create_file("debug", 0644,
1923 priv->debugfs_dir, &items[0], 1927 priv->debugfs_dir, &items[0],