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: <465DF566.7000000@oracle.com>
Date:	Wed, 30 May 2007 15:06:30 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	Christoph Lameter <clameter@....com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3 -mm] slub: use lib/hexdump

Christoph Lameter wrote:
> I'd prefer something like this:
> 
> Use hexdump in slub.

Sure, that's fine.

> Signed-off-by: Christoph Lameter <clameter@....com>
> 
> Index: slub/mm/slub.c
> ===================================================================
> --- slub.orig/mm/slub.c	2007-05-30 14:56:14.000000000 -0700
> +++ slub/mm/slub.c	2007-05-30 15:01:33.000000000 -0700
> @@ -339,34 +339,10 @@ static char *slub_debug_slabs;
>   */
>  static void print_section(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(" %02x", addr[i]);
> -		offset = i % 16;
> -		ascii[offset] = isgraph(addr[i]) ? addr[i] : '.';
> -		if (offset == 15) {
> -			printk(" %s\n",ascii);
> -			newline = 1;
> -		}
> -	}
> -	if (!newline) {
> -		i %= 16;
> -		while (i < 16) {
> -			printk("   ");
> -			ascii[i] = ' ';
> -			i++;
> -		}
> -		printk(" %s\n", ascii);
> -	}
> +	char buf[10];
> +
> +	sprintf(buf, "%8s:", text);
> +	print_hex_dump(KERN_ERR, buf, DUMP_PREFIX_ADDRESS, 16, 1, addr, length, 1);
>  }
>  
>  static struct track *get_track(struct kmem_cache *s, void *object,
> 


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
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