summaryrefslogtreecommitdiffstats
path: root/libebl
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2015-09-09 12:32:07 -0700
committerMark Wielaard <mjw@redhat.com>2015-09-14 13:41:12 +0200
commit2d982861e5e23d38653df7d8dce1d2282cda8ce1 (patch)
tree9b8f87ff115c16043e4a0e41faf4d9ca87795efb /libebl
parent879850950bd56255cb5796c86b62bf3bdedd4fb9 (diff)
Remove redundant NULL tests.
GCC6 and Clang give warnings on redundant NULL tests of parameters that are declared with __nonnull_attribute__. Signed-off-by: Chih-Hung Hsieh <chh@google.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libebl')
-rw-r--r--libebl/ChangeLog8
-rw-r--r--libebl/ebldwarftoregno.c3
-rw-r--r--libebl/eblinitreg.c3
-rw-r--r--libebl/eblnormalizepc.c3
-rw-r--r--libebl/eblunwind.c3
5 files changed, 15 insertions, 5 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 60ae566d..aab08571 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,11 @@
+2015-09-09 Chih-Hung Hsieh <chh@google.com>
+
+ * ebldwarftoregno.c (ebl_dwarf_to_regno): Remove redundant NULL tests
+ on parameters declared with __nonnull_attribute__.
+ * eblinitreg.c (ebl_frame_nregs): Likewise.
+ * eblnormalizepc.c (ebl_normalize_pc): Likewise.
+ * eblunwind.c (ebl_unwind): Likewise.
+
2015-09-04 Chih-Hung Hsieh <chh@google.com>
* eblopenbackend.c (ebl_openbackend_machine): Replace K&R function
diff --git a/libebl/ebldwarftoregno.c b/libebl/ebldwarftoregno.c
index 8fb85401..c6644969 100644
--- a/libebl/ebldwarftoregno.c
+++ b/libebl/ebldwarftoregno.c
@@ -35,7 +35,6 @@
bool
ebl_dwarf_to_regno (Ebl *ebl, unsigned *regno)
{
- if (ebl == NULL)
- return false;
+ /* ebl is declared NN */
return ebl->dwarf_to_regno == NULL ? true : ebl->dwarf_to_regno (ebl, regno);
}
diff --git a/libebl/eblinitreg.c b/libebl/eblinitreg.c
index 5729b3cc..8a3fb18a 100644
--- a/libebl/eblinitreg.c
+++ b/libebl/eblinitreg.c
@@ -47,7 +47,8 @@ ebl_set_initial_registers_tid (Ebl *ebl, pid_t tid,
size_t
ebl_frame_nregs (Ebl *ebl)
{
- return ebl == NULL ? 0 : ebl->frame_nregs;
+ /* ebl is declared NN */
+ return ebl->frame_nregs;
}
GElf_Addr
diff --git a/libebl/eblnormalizepc.c b/libebl/eblnormalizepc.c
index a5fea77e..1629353d 100644
--- a/libebl/eblnormalizepc.c
+++ b/libebl/eblnormalizepc.c
@@ -35,6 +35,7 @@
void
ebl_normalize_pc (Ebl *ebl, Dwarf_Addr *pc)
{
- if (ebl != NULL && ebl->normalize_pc != NULL)
+ /* ebl is declared NN */
+ if (ebl->normalize_pc != NULL)
ebl->normalize_pc (ebl, pc);
}
diff --git a/libebl/eblunwind.c b/libebl/eblunwind.c
index 1251c1b5..2970d03e 100644
--- a/libebl/eblunwind.c
+++ b/libebl/eblunwind.c
@@ -37,7 +37,8 @@ ebl_unwind (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc,
ebl_tid_registers_get_t *getfunc, ebl_pid_memory_read_t *readfunc,
void *arg, bool *signal_framep)
{
- if (ebl == NULL || ebl->unwind == NULL)
+ /* ebl is declared NN */
+ if (ebl->unwind == NULL)
return false;
return ebl->unwind (ebl, pc, setfunc, getfunc, readfunc, arg, signal_framep);
}