Skip to content

Commit

Permalink
9pfs: avoid sign conversion error simplifying the code
Browse files Browse the repository at this point in the history
(note this is how other functions also handle the errors).

hw/9pfs/9p.c:948:18: warning: Loss of sign in implicit conversion
        offset = err;
                 ^~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
  • Loading branch information
philmd authored and gkurz committed Sep 5, 2017
1 parent 53e2c48 commit 403a905
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hw/9pfs/9p.c
Expand Up @@ -945,7 +945,6 @@ static void coroutine_fn v9fs_version(void *opaque)
v9fs_string_init(&version);
err = pdu_unmarshal(pdu, offset, "ds", &s->msize, &version);
if (err < 0) {
offset = err;
goto out;
}
trace_v9fs_version(pdu->tag, pdu->id, s->msize, version.data);
Expand All @@ -962,13 +961,12 @@ static void coroutine_fn v9fs_version(void *opaque)

err = pdu_marshal(pdu, offset, "ds", s->msize, &version);
if (err < 0) {
offset = err;
goto out;
}
offset += err;
err += offset;
trace_v9fs_version_return(pdu->tag, pdu->id, s->msize, version.data);
out:
pdu_complete(pdu, offset);
pdu_complete(pdu, err);
v9fs_string_free(&version);
}

Expand Down

0 comments on commit 403a905

Please sign in to comment.