Skip to content

Commit 7f3838f

Browse files
Tomas Winklergregkh
authored andcommitted
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 b40b3e9 ("mei: bus: type promotion bug in mei_nfc_if_version()") commit cf1ed2c ("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: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d9995a0 commit 7f3838f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/misc/mei/bus-fixup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static int mei_fwver(struct mei_cl_device *cldev)
181181
ret = 0;
182182
bytes_recv = __mei_cl_recv(cldev->cl, buf, sizeof(buf), 0,
183183
MKHI_RCV_TIMEOUT);
184-
if (bytes_recv < 0 || bytes_recv < MKHI_FWVER_LEN(1)) {
184+
if (bytes_recv < 0 || (size_t)bytes_recv < MKHI_FWVER_LEN(1)) {
185185
/*
186186
* Should be at least one version block,
187187
* error out if nothing found
@@ -193,7 +193,7 @@ static int mei_fwver(struct mei_cl_device *cldev)
193193
fwver = (struct mkhi_fw_ver *)req->data;
194194
memset(cldev->bus->fw_ver, 0, sizeof(cldev->bus->fw_ver));
195195
for (i = 0; i < MEI_MAX_FW_VER_BLOCKS; i++) {
196-
if (bytes_recv < MKHI_FWVER_LEN(i + 1))
196+
if ((size_t)bytes_recv < MKHI_FWVER_LEN(i + 1))
197197
break;
198198
dev_dbg(&cldev->dev, "FW version%d %d:%d.%d.%d.%d\n",
199199
i, fwver->ver[i].platform,
@@ -341,7 +341,7 @@ static int mei_nfc_if_version(struct mei_cl *cl,
341341

342342
ret = 0;
343343
bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length, 0, 0);
344-
if (bytes_recv < 0 || bytes_recv < if_version_length) {
344+
if (bytes_recv < 0 || (size_t)bytes_recv < if_version_length) {
345345
dev_err(bus->dev, "Could not read IF version\n");
346346
ret = -EIO;
347347
goto err;

0 commit comments

Comments
 (0)