diff options
author | Simran Singhal <singhalsimran0@gmail.com> | 2020-04-01 22:23:14 +0530 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-05-04 14:43:22 +0200 |
commit | b3ac2b94cdc939a90d5a22338ae507689e2cfab0 (patch) | |
tree | 4586d31cee093411409945cdf2804f99ac93c5a2 /hw/audio | |
parent | 949da1eb9db9df0d998ad2f3086979e4e23a44a1 (diff) | |
download | qemu-b3ac2b94cdc939a90d5a22338ae507689e2cfab0.zip |
Compress lines for immediate return
Compress two lines into a single line if immediate return statement is found.
It also remove variables progress, val, data, ret and sock
as they are no longer needed.
Remove space between function "mixer_load" and '(' to fix the
checkpatch.pl error:-
ERROR: space prohibited between function name and open parenthesis '('
Done using following coccinelle script:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Simran Singhal <singhalsimran0@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20200401165314.GA3213@simran-Inspiron-5558>
[lv: in handle_aiocb_write_zeroes_unmap() move "int ret" inside the #ifdef]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/audio')
-rw-r--r-- | hw/audio/ac97.c | 4 | ||||
-rw-r--r-- | hw/audio/adlib.c | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 1ec87feec0..8a9b9924c4 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -573,11 +573,9 @@ static uint32_t nam_readb (void *opaque, uint32_t addr) static uint32_t nam_readw (void *opaque, uint32_t addr) { AC97LinkState *s = opaque; - uint32_t val = ~0U; uint32_t index = addr; s->cas = 0; - val = mixer_load (s, index); - return val; + return mixer_load(s, index); } static uint32_t nam_readl (void *opaque, uint32_t addr) diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index d6c1fb0586..7c3b67dcfb 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -120,13 +120,10 @@ static void adlib_write(void *opaque, uint32_t nport, uint32_t val) static uint32_t adlib_read(void *opaque, uint32_t nport) { AdlibState *s = opaque; - uint8_t data; int a = nport & 3; adlib_kill_timers (s); - data = OPLRead (s->opl, a); - - return data; + return OPLRead (s->opl, a); } static void timer_handler (void *opaque, int c, double interval_Sec) |