0093-pmap: Remove dead code in mapping_name().
If "cp = strrchr(mapbuf_b, '/')" then this function returns, and otherwise there is no '/' in mapbuf_b and "cp = strchr(mapbuf_b, '/')" is always false: remove this second block, since it is never entered. Also, constify a few things in this function. Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
parent
991b41cb32
commit
7d3b4bcaf2
12
pmap.c
12
pmap.c
@ -212,12 +212,12 @@ out_destroy:
|
||||
return;
|
||||
}
|
||||
|
||||
static char *mapping_name(struct pids_stack *p, unsigned long addr,
|
||||
static const char *mapping_name(struct pids_stack *p, unsigned long addr,
|
||||
unsigned long len, const char *mapbuf_b,
|
||||
unsigned showpath, unsigned dev_major,
|
||||
unsigned dev_minor, unsigned long long inode)
|
||||
{
|
||||
char *cp;
|
||||
const char *cp;
|
||||
|
||||
if (!dev_major && dev_minor == shm_minor && strstr(mapbuf_b, "/SYSV")) {
|
||||
static char shmbuf[64];
|
||||
@ -232,14 +232,6 @@ static char *mapping_name(struct pids_stack *p, unsigned long addr,
|
||||
return cp[1] ? cp + 1 : cp;
|
||||
}
|
||||
|
||||
cp = strchr(mapbuf_b, '/');
|
||||
if (cp) {
|
||||
if (showpath)
|
||||
return cp;
|
||||
/* it WILL succeed */
|
||||
return strrchr(cp, '/') + 1;
|
||||
}
|
||||
|
||||
cp = _(" [ anon ]");
|
||||
if (PIDS_VAL(start_stack, ul_int, p, Pids_info) >= addr
|
||||
&& (PIDS_VAL(start_stack, ul_int, p, Pids_info) <= addr + len))
|
||||
|
Loading…
Reference in New Issue
Block a user