lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0905201420050.17511@qirst.com>
Date:	Wed, 20 May 2009 14:23:00 -0400 (EDT)
From:	Christoph Lameter <cl@...ux-foundation.org>
To:	Joe Perches <joe@...ches.com>
cc:	linux-kernel@...r.kernel.org,
	H Hartley Sweeten <hartleys@...ionengravers.com>,
	linux-mm@...ck.org, Matt Mackall <mpm@...enic.com>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Ingo Molnar <mingo@...e.hu>,
	David Rientjes <rientjes@...gle.com>,
	Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
Subject: Re: [PATCH] mm/slub.c: Use print_hex_dump and remove unnecessary
 cast

This was discussed before.

http://lkml.indiana.edu/hypermail/linux/kernel/0705.3/2671.html

Was hexdump changed? How does the output look after this change?

On Wed, 20 May 2009, Joe Perches wrote:

> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
>  mm/slub.c |   34 ++++------------------------------
>  1 files changed, 4 insertions(+), 30 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 65ffda5..5b616d6 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -328,36 +328,10 @@ static char *slub_debug_slabs;
>  /*
>   * Object debugging
>   */
> -static void print_section(char *text, u8 *addr, unsigned int length)
> +static void print_section(const char *text, u8 *addr, unsigned int length)
>  {
> -	int i, offset;
> -	int newline = 1;
> -	char ascii[17];
> -
> -	ascii[16] = 0;
> -
> -	for (i = 0; i < length; i++) {
> -		if (newline) {
> -			printk(KERN_ERR "%8s 0x%p: ", text, addr + i);
> -			newline = 0;
> -		}
> -		printk(KERN_CONT " %02x", addr[i]);
> -		offset = i % 16;
> -		ascii[offset] = isgraph(addr[i]) ? addr[i] : '.';
> -		if (offset == 15) {
> -			printk(KERN_CONT " %s\n", ascii);
> -			newline = 1;
> -		}
> -	}
> -	if (!newline) {
> -		i %= 16;
> -		while (i < 16) {
> -			printk(KERN_CONT "   ");
> -			ascii[i] = ' ';
> -			i++;
> -		}
> -		printk(KERN_CONT " %s\n", ascii);
> -	}
> +	print_hex_dump(KERN_ERR, text, DUMP_PREFIX_ADDRESS, 16, 1,
> +		       addr, length, true);
>  }
>
>  static struct track *get_track(struct kmem_cache *s, void *object,
> @@ -794,7 +768,7 @@ static void trace(struct kmem_cache *s, struct page *page, void *object,
>  			page->freelist);
>
>  		if (!alloc)
> -			print_section("Object", (void *)object, s->objsize);
> +			print_section("Object", object, s->objsize);
>
>  		dump_stack();
>  	}
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ