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]
Date:	Wed, 2 Jul 2014 14:54:10 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:	"John W. Linville" <linville@...driver.com>,
	Johannes Berg <johannes@...solutions.net>,
	devel@...verdev.osuosl.org, linux-wireless@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 1/6] lib / string_helpers: clean up test suite

On Wed,  2 Jul 2014 16:20:24 +0300 Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:

> This patch prepares test suite for a following update. It introduces
> test_string_check_buf() helper which checks the result and dumps an error.
> 
> ...
>
> --- a/lib/test-string_helpers.c
> +++ b/lib/test-string_helpers.c
> @@ -10,6 +10,26 @@
>  #include <linux/string.h>
>  #include <linux/string_helpers.h>
>  
> +static __init bool test_string_check_buf(const char *name, unsigned int flags,
> +					 char *in, size_t p,
> +					 char *out_real, size_t q_real,
> +					 char *out_test, size_t q_test)
> +{
> +	if (q_real == q_test && !memcmp(out_test, out_real, q_test))
> +		return true;
> +
> +	pr_err("Test '%s' failed: flags = %u\n", name, flags);
> +
> +	print_hex_dump(KERN_WARNING, "Input: ", DUMP_PREFIX_NONE, 16, 1,
> +		       in, p, true);
> +	print_hex_dump(KERN_WARNING, "Expected: ", DUMP_PREFIX_NONE, 16, 1,
> +		       out_test, q_test, true);
> +	print_hex_dump(KERN_WARNING, "Got: ", DUMP_PREFIX_NONE, 16, 1,
> +		       out_real, q_real, true);

Seems strange to mix KERN_ERR and KERN_WARNING.  The code's always been
that way, but maybe it can be improved.


--
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