[PATCH v2 6/7] Mute some compiler warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch mutes follwing compiler warnings:
  - warning: assignment discards ?const? qualifier from
    pointer target type [enabled by default],
  - warning: variable ?page_offset? set but not used
    [-Wunused-but-set-variable].

v2 - suggestions/fixes:
   - do not discard a const qualifier
     (suggested by Andrew Cooper).

Signed-off-by: Daniel Kiper <daniel.kiper at oracle.com>
---
 dwarf_info.c  |   14 ++++++++------
 sadump_info.c |    2 --
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dwarf_info.c b/dwarf_info.c
index 6e21b8a..85c116e 100644
--- a/dwarf_info.c
+++ b/dwarf_info.c
@@ -1381,6 +1381,7 @@ int
 get_die_member(unsigned long long die_off, int index, long *offset,
 		char **name, int *nbits, int *fbits, unsigned long long *m_die)
 {
+	const char *diename;
 	int tag, size, nfields = 0;
 	Dwarf_Die result, child, die_base, *die;
 
@@ -1427,14 +1428,14 @@ get_die_member(unsigned long long die_off, int index, long *offset,
 	if (!get_data_member_location(die, offset))
 		*offset = 0;
 
-	*name = dwarf_diename(die);
+	diename = dwarf_diename(die);
 	/*
 	 * Duplicate the string before we pass it to eppic layer. The
 	 * original string returned by dwarf layer will become invalid
 	 * after clean_dwfl_info() call.
 	 */
-	if (*name)
-		*name = strdup(*name);
+	if (diename)
+		*name = strdup(diename);
 	*m_die = dwarf_dieoffset(die);
 
 	get_die_type(die, &die_base);
@@ -1504,6 +1505,7 @@ get_die_name(unsigned long long die_off)
 {
 	Dwarf_Die result;
 	char *name = NULL;
+	const char *diename;
 
 	if (!die_off)
 		return NULL;
@@ -1513,9 +1515,9 @@ get_die_name(unsigned long long die_off)
 		return NULL;
 	}
 
-	name = dwarf_diename(&result);
-	if (name)
-		name = strdup(name);
+	diename = dwarf_diename(&result);
+	if (diename)
+		name = strdup(diename);
 	clean_dwfl_info();
 	return name;
 }
diff --git a/sadump_info.c b/sadump_info.c
index be6cf55..01cf5eb 100644
--- a/sadump_info.c
+++ b/sadump_info.c
@@ -948,7 +948,6 @@ int
 readpage_sadump(unsigned long long paddr, void *bufptr)
 {
 	unsigned long long pfn, block, whole_offset, perdisk_offset;
-	ulong page_offset;
 	int fd_memory;
 
 	if (si->kdump_backed_up &&
@@ -957,7 +956,6 @@ readpage_sadump(unsigned long long paddr, void *bufptr)
 		paddr += si->backup_offset - si->backup_src_start;
 
 	pfn = paddr_to_pfn(paddr);
-	page_offset = paddr % info->page_size;
 
 	if (pfn >= si->sh_memory->max_mapnr)
 		return FALSE;
-- 
1.7.10.4




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux