[v2,5/5] gdb: remove unnecessary nullptr check in remove_user_added_objfile

Message ID 20240207165445.117512-6-simon.marchi@efficios.com
State New
Headers
Series Random cleanup patches |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Simon Marchi Feb. 7, 2024, 4:53 p.m. UTC
  Since commit 74daa597e74 ("gdb: add all_objfiles_removed observer"), the
objfile passed to the free_objfile observable can't be nullptr.

Change-Id: If215aa051ab43c068b11746938022c7efca09caa
---
 gdb/solib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gdb/solib.c b/gdb/solib.c
index 991ff156d12f..952897c37fc9 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1695,7 +1695,7 @@  gdb_bfd_lookup_symbol (bfd *abfd,
 static void
 remove_user_added_objfile (struct objfile *objfile)
 {
-  if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
+  if (objfile->flags & OBJF_USERLOADED)
     {
       for (solib &so : objfile->pspace->solibs ())
 	if (so.objfile == objfile)