This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

Fix warning in elf/sprof.c


Looking at the warnings, I found some dead code in elf/sprof.c.

Also, I suggest to apply Marek's patch from http://sourceware.org/ml/libc-
alpha/2011-06/msg00114.html to fix a warning in dl-lookup.c.

Andreas

2011-08-17  Andreas Jaeger  <aj@suse.de>

	* elf/sprof.c (load_shobj): Remove unused variable
	log_hashfraction.


-- 
 Andreas Jaeger, Program Manager openSUSE
  aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
diff --git a/elf/sprof.c b/elf/sprof.c
index 6f12579..dbe217b 100644
--- a/elf/sprof.c
+++ b/elf/sprof.c
@@ -404,7 +404,6 @@ load_shobj (const char *name)
   ElfW(Addr) mapend = 0;
   const ElfW(Phdr) *ph;
   size_t textsize;
-  unsigned int log_hashfraction;
   ElfW(Ehdr) *ehdr;
   int fd;
   ElfW(Shdr) *shdr;
@@ -474,13 +473,6 @@ load_shobj (const char *name)
   textsize = result->highpc - result->lowpc;
   result->kcountsize = textsize / HISTFRACTION;
   result->hashfraction = HASHFRACTION;
-  if ((HASHFRACTION & (HASHFRACTION - 1)) == 0)
-    /* If HASHFRACTION is a power of two, mcount can use shifting
-       instead of integer division.  Precompute shift amount.  */
-    log_hashfraction = __builtin_ffs (result->hashfraction
-				      * sizeof (struct here_fromstruct)) - 1;
-  else
-    log_hashfraction = -1;
   if (do_test)
     printf ("hashfraction = %d\ndivider = %Zu\n",
 	    result->hashfraction,

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