This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Remove return value of fixup_psymbol_section


Hi, fixup_psymbol_section returns a 'struct partial_symbol *' variable,
either NULL or argument PSYM.  The return value is never used.  This
patch is to remove the return value of function fixup_psymbol_section.
Is it OK?

gdb:

2012-12-26  Yao Qi  <yao@codesourcery.com>

	* psymtab.c (fixup_psymbol_section): Update declaration.
	(fixup_psymbol_section): Remove code returning value.
---
 gdb/psymtab.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 2b4d9f9..409f96b 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -65,9 +65,8 @@ static struct partial_symbol *find_pc_sect_psymbol (struct objfile *,
 						    CORE_ADDR,
 						    struct obj_section *);
 
-static struct partial_symbol *fixup_psymbol_section (struct partial_symbol
-						     *psym,
-						     struct objfile *objfile);
+static void fixup_psymbol_section (struct partial_symbol *psym,
+				   struct objfile *objfile);
 
 static struct symtab *psymtab_to_symtab (struct objfile *objfile,
 					 struct partial_symtab *pst);
@@ -480,16 +479,13 @@ find_pc_sect_psymbol (struct objfile *objfile,
   return best;
 }
 
-static struct partial_symbol *
+static void
 fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
 {
   CORE_ADDR addr;
 
-  if (!psym)
-    return NULL;
-
-  if (SYMBOL_OBJ_SECTION (psym))
-    return psym;
+  if (psym == NULL || SYMBOL_OBJ_SECTION (psym) != NULL)
+    return;
 
   gdb_assert (objfile);
 
@@ -503,12 +499,10 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
     default:
       /* Nothing else will be listed in the minsyms -- no use looking
 	 it up.  */
-      return psym;
+      return;
     }
 
   fixup_section (&psym->ginfo, addr, objfile);
-
-  return psym;
 }
 
 static struct symtab *
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]