Patchwork linux-user: Use macro TARGET_NSIG_WORDS were possible

login
register
mail settings
Submitter Stefan Weil
Date Dec. 7, 2013, 8:51 a.m.
Message ID <1386406291-18509-1-git-send-email-sw@weilnetz.de>
Download mbox | patch
Permalink /patch/298640/
State Superseded
Headers show

Comments

Stefan Weil - Dec. 7, 2013, 8:51 a.m.
This improves readability and simplifies the code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 linux-user/signal.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 7751c47..8f692cd 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -2537,9 +2537,9 @@  void sparc64_set_context(CPUSPARCState *env)
             abi_ulong *src, *dst;
             src = ucp->tuc_sigmask.sig;
             dst = target_set.sig;
-            for (i = 0; i < sizeof(target_sigset_t) / sizeof(abi_ulong);
-                 i++, dst++, src++)
+            for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
                 err |= __get_user(*dst, src);
+            }
             if (err)
                 goto do_sigsegv;
         }
@@ -2642,9 +2642,9 @@  void sparc64_get_context(CPUSPARCState *env)
         abi_ulong *src, *dst;
         src = target_set.sig;
         dst = ucp->tuc_sigmask.sig;
-        for (i = 0; i < sizeof(target_sigset_t) / sizeof(abi_ulong);
-             i++, dst++, src++)
+        for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
             err |= __put_user(*src, dst);
+        }
         if (err)
             goto do_sigsegv;
     }