Skip to content

Commit 1fb9973

Browse files
maurizio-lombardidwsuse
authored andcommitted
mi: fix a static checker warning in examples/mi-mctp
tmp is an "unsigned long" variable so it can't be less than zero. Signed-off-by: Maurizio Lombardi <[email protected]>
1 parent 418596b commit 1fb9973

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/mi-mctp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,14 @@ int do_admin_raw(nvme_mi_ep_t ep, int argc, char **argv)
347347
}
348348

349349
tmp = atoi(argv[1]);
350-
if (tmp < 0 || tmp > 0xffff) {
350+
if (tmp > 0xffff) {
351351
fprintf(stderr, "invalid controller ID\n");
352352
return -1;
353353
}
354354
ctrl_id = tmp & 0xffff;
355355

356356
tmp = atoi(argv[2]);
357-
if (tmp < 0 || tmp > 0xff) {
357+
if (tmp > 0xff) {
358358
fprintf(stderr, "invalid opcode\n");
359359
return -1;
360360
}
@@ -461,7 +461,7 @@ int do_security_info(nvme_mi_ep_t ep, int argc, char **argv)
461461
}
462462

463463
tmp = atoi(argv[1]);
464-
if (tmp < 0 || tmp > 0xffff) {
464+
if (tmp > 0xffff) {
465465
fprintf(stderr, "invalid controller ID\n");
466466
return -1;
467467
}

0 commit comments

Comments
 (0)