s390x/mmu: Remove duplicate check for MMU_DATA_STORE
PATCH 1/1 s390x/mmu: Remove duplicate check for MMU_DATA_STORE
No need to double-check if we have a write.
Found by Coverity (CID: 1381016).
Fixes 31b59419069e ("target/s390x: Return exception from mmu_translate_real")
Cc Peter Maydell <[email protected]>
Signed-off-by David Hildenbrand <[email protected]>
--- target/s390x/mmu_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
target/s390x/mmu_helper.c +1 -3
@@ -556,9 +556,7 @@ int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, *flags |=PAGE_WRITE_INV ;if (is_low_address (raddr) && rw ==MMU_DATA_STORE ) {/* LAP sets bit 56 */ - *tec = (raddr &TARGET_PAGE_MASK ) - | (rw ==MMU_DATA_STORE ?FS_WRITE :FS_READ ) - |0x80 ; + *tec = (raddr &TARGET_PAGE_MASK ) |FS_WRITE |0x80 ;return PGM_PROTECTION ; } }
Signature · 1 line
2.21.0
Quoted 3 lines · David Hildenbrand
No need to double-check if we have a write.
Found by Coverity (CID: 1381016).
Copy and past error, it's 1406404.
Quoted 24 lines
Fixes 31b59419069e ("target/s390x: Return exception from mmu_translate_real")Cc Peter Maydell <[email protected]>Signed-off-by David Hildenbrand <[email protected]>--- target/s390x/mmu_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)target/s390x/mmu_helper.c +1
-3@@ -556,9 +556,7 @@ int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, *flags |=PAGE_WRITE_INV ;if (is_low_address (raddr) && rw ==MMU_DATA_STORE ) {/* LAP sets bit 56 */ - *tec = (raddr &TARGET_PAGE_MASK ) - | (rw ==MMU_DATA_STORE ?FS_WRITE :FS_READ ) - |0x80 ; + *tec = (raddr &TARGET_PAGE_MASK ) |FS_WRITE |0x80 ;return PGM_PROTECTION ; } }
Signature · 3 lines
Thanks, David / dhildenb
Richard Henderson
Reviewed-byQuoted 12 lines · David Hildenbrand
Quoted 3 lines · David Hildenbrand
No need to double-check if we have a write.
Found by Coverity (CID: 1381016).
Copy and past error, it's 1406404.
Quoted 5 lines
Fixes 31b59419069e ("target/s390x: Return exception from mmu_translate_real")Cc Peter Maydell <[email protected]>Signed-off-by David Hildenbrand <[email protected]>---
Reviewed-by Richard Henderson <[email protected]>
r~
Cornelia Huck
AppliedQuoted 16 lines · On Thu, 17 Oct 2019 14:19:22 +0200 David Hildenbrand <[email protected]> wrote:
No need to double-check if we have a write.
Found by Coverity (CID: 1381016).
Fixes 31b59419069e ("target/s390x: Return exception from mmu_translate_real")Cc Peter Maydell <[email protected]>Signed-off-by David Hildenbrand <[email protected]>--- target/s390x/mmu_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)target/s390x/mmu_helper.c +0
-0
target/s390x/mmu_helper.c int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, · line 562
Quoted 10 lines
target/s390x/mmu_helper.c +1
-3@@ -556,9 +556,7 @@ int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, *flags |=PAGE_WRITE_INV ;if (is_low_address (raddr) && rw ==MMU_DATA_STORE ) {/* LAP sets bit 56 */ - *tec = (raddr &TARGET_PAGE_MASK ) - | (rw ==MMU_DATA_STORE ?FS_WRITE :FS_READ ) - |0x80 ; + *tec = (raddr &TARGET_PAGE_MASK ) |FS_WRITE |0x80 ;return PGM_PROTECTION ; } }
Thanks, applied.