Commit 7f3838fb authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: bus: suppress sign-compare warnings

Comparison between signed and unsigned warnings
and associated type promotion may cause error
condition not be detected.
The type promotion issue in mei bus was addressed by two patches:
commit b40b3e93 ("mei: bus: type promotion bug in mei_nfc_if_version()")
commit cf1ed2c5 ("mei: bus: type promotion bug in mei_fwver()")
Now it is possible to suppress the warning, by adding proper
casting to move out of radar.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d9995a0f
...@@ -181,7 +181,7 @@ static int mei_fwver(struct mei_cl_device *cldev) ...@@ -181,7 +181,7 @@ static int mei_fwver(struct mei_cl_device *cldev)
ret = 0; ret = 0;
bytes_recv = __mei_cl_recv(cldev->cl, buf, sizeof(buf), 0, bytes_recv = __mei_cl_recv(cldev->cl, buf, sizeof(buf), 0,
MKHI_RCV_TIMEOUT); MKHI_RCV_TIMEOUT);
if (bytes_recv < 0 || bytes_recv < MKHI_FWVER_LEN(1)) { if (bytes_recv < 0 || (size_t)bytes_recv < MKHI_FWVER_LEN(1)) {
/* /*
* Should be at least one version block, * Should be at least one version block,
* error out if nothing found * error out if nothing found
...@@ -193,7 +193,7 @@ static int mei_fwver(struct mei_cl_device *cldev) ...@@ -193,7 +193,7 @@ static int mei_fwver(struct mei_cl_device *cldev)
fwver = (struct mkhi_fw_ver *)req->data; fwver = (struct mkhi_fw_ver *)req->data;
memset(cldev->bus->fw_ver, 0, sizeof(cldev->bus->fw_ver)); memset(cldev->bus->fw_ver, 0, sizeof(cldev->bus->fw_ver));
for (i = 0; i < MEI_MAX_FW_VER_BLOCKS; i++) { for (i = 0; i < MEI_MAX_FW_VER_BLOCKS; i++) {
if (bytes_recv < MKHI_FWVER_LEN(i + 1)) if ((size_t)bytes_recv < MKHI_FWVER_LEN(i + 1))
break; break;
dev_dbg(&cldev->dev, "FW version%d %d:%d.%d.%d.%d\n", dev_dbg(&cldev->dev, "FW version%d %d:%d.%d.%d.%d\n",
i, fwver->ver[i].platform, i, fwver->ver[i].platform,
...@@ -341,7 +341,7 @@ static int mei_nfc_if_version(struct mei_cl *cl, ...@@ -341,7 +341,7 @@ static int mei_nfc_if_version(struct mei_cl *cl,
ret = 0; ret = 0;
bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length, 0, 0); bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length, 0, 0);
if (bytes_recv < 0 || bytes_recv < if_version_length) { if (bytes_recv < 0 || (size_t)bytes_recv < if_version_length) {
dev_err(bus->dev, "Could not read IF version\n"); dev_err(bus->dev, "Could not read IF version\n");
ret = -EIO; ret = -EIO;
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment