Building commit 6a98cf032b on an x86_64 box, I get the following errors.
Attached patch fixes them, and builds clean on 32 bit also.
I used size_t, which changes size like uintptr_t, but is an integer type.
Also changed return typ of acx_dbgfs_write(), to comport with actual
type expected in struct file_operations (not the type in acx_proc_write_*)
CC [M] /home/jimc/projects/lx/acx-mac80211/debugfs.o
/home/jimc/projects/lx/acx-mac80211/debugfs.c: In function 'acx_dbgfs_open':
/home/jimc/projects/lx/acx-mac80211/debugfs.c:61:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/home/jimc/projects/lx/acx-mac80211/debugfs.c: In function 'acx_dbgfs_write':
/home/jimc/projects/lx/acx-mac80211/debugfs.c:90:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/home/jimc/projects/lx/acx-mac80211/debugfs.c: At top level:
/home/jimc/projects/lx/acx-mac80211/debugfs.c:117:2: warning: initialization from incompatible pointer type [enabled by default]
/home/jimc/projects/lx/acx-mac80211/debugfs.c:117:2: warning: (near initialization for 'acx_fops.write') [enabled by default]
/home/jimc/projects/lx/acx-mac80211/debugfs.c: In function 'acx_debugfs_add_adev':
/home/jimc/projects/lx/acx-mac80211/debugfs.c:158:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Jim Cromie <jim...@gm...>
---
debugfs.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/debugfs.c b/debugfs.c
index cd403bc..e47757b 100644
--- a/debugfs.c
+++ b/debugfs.c
@@ -58,7 +58,7 @@ BUILD_BUG_DECL(dbgfs_files__VS__enum_REG_DOMAIN,
static int acx_dbgfs_open(struct inode *inode, struct file *file)
{
- int fidx = (int) inode->i_private;
+ size_t fidx = (size_t) inode->i_private;
struct acx_device *adev = (struct acx_device *)
file->f_path.dentry->d_parent->d_inode->i_private;
@@ -73,21 +73,21 @@ static int acx_dbgfs_open(struct inode *inode, struct file *file)
case ANTENNA:
case REG_DOMAIN:
pr_info("opening filename=%s fmode=%o fidx=%d adev=%p\n",
- dbgfs_files[fidx], file->f_mode, fidx, adev);
+ dbgfs_files[fidx], file->f_mode, (int)fidx, adev);
break;
default:
- pr_err("unknown file @ %d: %s\n", fidx,
+ pr_err("unknown file @ %d: %s\n", (int)fidx,
file->f_path.dentry->d_name.name);
return -ENOENT;
}
return single_open(file, acx_proc_show_funcs[fidx], adev);
}
-static int acx_dbgfs_write(struct file *file, const char __user *buf,
+static ssize_t acx_dbgfs_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
/* retrieve file-index and adev from private fields */
- int fidx = (int) file->f_path.dentry->d_inode->i_private;
+ size_t fidx = (size_t) file->f_path.dentry->d_inode->i_private;
struct acx_device *adev = (struct acx_device *)
file->f_path.dentry->d_parent->d_inode->i_private;
@@ -102,10 +102,10 @@ static int acx_dbgfs_write(struct file *file, const char __user *buf,
case ANTENNA:
case REG_DOMAIN:
pr_info("opening filename=%s fmode=%o fidx=%d adev=%p\n",
- dbgfs_files[fidx], file->f_mode, fidx, adev);
+ dbgfs_files[fidx], file->f_mode, (int)fidx, adev);
break;
default:
- pr_err("unknown file @ %d: %s\n", fidx,
+ pr_err("unknown file @ %d: %s\n", (int)fidx,
file->f_path.dentry->d_name.name);
return -ENOENT;
}
@@ -125,7 +125,7 @@ static struct dentry *acx_dbgfs_dir;
int acx_debugfs_add_adev(struct acx_device *adev)
{
- int i;
+ size_t i;
int fmode;
struct dentry *file;
const char *devname = wiphy_name(adev->ieee->wiphy);
--
1.7.10.1.487.ga3935e6
|