You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/27 11:18:40 UTC

[incubator-nuttx] branch master updated: sched/signal: Remove redundant checks

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 8acff49  sched/signal: Remove redundant checks
8acff49 is described below

commit 8acff49a1485cb5306cb1381dbd8b343e080a5d9
Author: Yoshinori Sugino <ys...@gmail.com>
AuthorDate: Fri Nov 27 18:43:20 2020 +0900

    sched/signal: Remove redundant checks
---
 sched/signal/sig_allocpendingsigaction.c | 5 +----
 sched/signal/sig_dispatch.c              | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/sched/signal/sig_allocpendingsigaction.c b/sched/signal/sig_allocpendingsigaction.c
index 69fac39..3bf84db 100644
--- a/sched/signal/sig_allocpendingsigaction.c
+++ b/sched/signal/sig_allocpendingsigaction.c
@@ -100,10 +100,7 @@ FAR sigq_t *nxsig_alloc_pendingsigaction(void)
         {
           /* No...Try the resource pool */
 
-          if (!sigq)
-            {
-              sigq = (FAR sigq_t *)kmm_malloc((sizeof (sigq_t)));
-            }
+          sigq = (FAR sigq_t *)kmm_malloc((sizeof (sigq_t)));
 
           /* Check if we got an allocated message */
 
diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c
index 7f4ac04..7091e7c 100644
--- a/sched/signal/sig_dispatch.c
+++ b/sched/signal/sig_dispatch.c
@@ -172,10 +172,7 @@ static FAR sigpendq_t *nxsig_alloc_pendingsignal(void)
         {
           /* No... Allocate the pending signal */
 
-          if (!sigpend)
-            {
-              sigpend = (FAR sigpendq_t *)kmm_malloc((sizeof (sigpendq_t)));
-            }
+          sigpend = (FAR sigpendq_t *)kmm_malloc((sizeof (sigpendq_t)));
 
           /* Check if we got an allocated message */