Skip to contentSkip to conversation

target-ppc: Fix warnings from Sparse

PATCH Applied Stefan Weil 2 participants 2 messages Mar 7, 2015 – Mar 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-ppc: Fix warnings from Sparse

Sparse report:

target-ppc/mmu-hash64.c:353:9: warning: returning void-valued expression target-ppc/mmu-hash64.c:620:9: warning: returning void-valued expression

Cc Alexander Graf <[email protected]>

---

Should we fix this kind of warnings? QEMU includes more than 60 lines of code which return a void expression.

Stefan

 target-ppc/mmu-hash64.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
target-ppc/mmu-hash64.c +3 -2
index b0278c9..a9e1b4c 100644
@@ -350,7 +350,7 @@ uint64_t ppc_hash64_start_access(PowerPCCPU *cpu, target_ulong pte_index)
 void ppc_hash64_stop_access(uint64_t token)
 {
     if (kvmppc_kern_htab) {
-        return kvmppc_hash64_free_pteg(token);
+        kvmppc_hash64_free_pteg(token);
     }
 }
 
@@ -617,7 +617,8 @@ void ppc_hash64_store_hpte(CPUPPCState *env,
     CPUState *cs = CPU(ppc_env_get_cpu(env));
 
     if (kvmppc_kern_htab) {
-        return kvmppc_hash64_write_pte(env, pte_index, pte0, pte1);
+        kvmppc_hash64_write_pte(env, pte_index, pte0, pte1);
+        return;
     }
 
     pte_index *= HASH_PTE_SIZE_64;
Signature · 1 line
2.1.4
#1 lore raw
Quoted 7 lines · Stefan Weil

Sparse report:

target-ppc/mmu-hash64.c:353:9: warning: returning void-valued expression target-ppc/mmu-hash64.c:620:9: warning: returning void-valued expression

Cc Alexander Graf <[email protected]>

I think it makes a lot of sense to fix these.

Thanks, applied to ppc-next (unfortunately after my pull request, so it'll only go in after rc0).

Alex