Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 276c4b4b authored by Luca Coelho's avatar Luca Coelho
Browse files

iwlwifi: mvm: use ssize_t for len in iwl_debugfs_mem_read()



In iwl_dbgfs_mem_read(), the len variable may become negative and is
compared to < 0 (an error case).  Comparing size_t (which is unsigned)
to < 0 causes a warning on certain platforms (like i386):

drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:1561:5-8: WARNING: Unsigned expression compared with zero: len < 0

To prevent that, use ssize_t for len instead.

Fixes: commit 2b55f43f ("iwlwifi: mvm: Add mem debugfs entry")
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent faead41c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1529,8 +1529,8 @@ static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf,
		.data = { &cmd, },
		.len = { sizeof(cmd) },
	};
	size_t delta, len;
	ssize_t ret;
	size_t delta;
	ssize_t ret, len;

	hcmd.id = iwl_cmd_id(*ppos >> 24 ? UMAC_RD_WR : LMAC_RD_WR,
			     DEBUG_GROUP, 0);