* [merged] lib-hexdump-return-einval-in-case-of-error-in-hex2bin.patch removed from -mm tree
@ 2017-09-11 19:42 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-09-11 19:42 UTC (permalink / raw)
To: andriy.shevchenko, arnd, linux, mm-commits
The patch titled
Subject: lib/hexdump.c: return -EINVAL in case of error in hex2bin()
has been removed from the -mm tree. Its filename was
lib-hexdump-return-einval-in-case-of-error-in-hex2bin.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: lib/hexdump.c: return -EINVAL in case of error in hex2bin()
In some cases caller would like to use error code directly without
shadowing.
-EINVAL feels a rightful code to return in case of error in hex2bin().
Link: http://lkml.kernel.org/r/20170731135510.68023-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/hexdump.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff -puN lib/hexdump.c~lib-hexdump-return-einval-in-case-of-error-in-hex2bin lib/hexdump.c
--- a/lib/hexdump.c~lib-hexdump-return-einval-in-case-of-error-in-hex2bin
+++ a/lib/hexdump.c
@@ -9,6 +9,7 @@
#include <linux/types.h>
#include <linux/ctype.h>
+#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <asm/unaligned.h>
@@ -42,7 +43,7 @@ EXPORT_SYMBOL(hex_to_bin);
* @src: ascii hexadecimal string
* @count: result length
*
- * Return 0 on success, -1 in case of bad input.
+ * Return 0 on success, -EINVAL in case of bad input.
*/
int hex2bin(u8 *dst, const char *src, size_t count)
{
@@ -51,7 +52,7 @@ int hex2bin(u8 *dst, const char *src, si
int lo = hex_to_bin(*src++);
if ((hi < 0) || (lo < 0))
- return -1;
+ return -EINVAL;
*dst++ = (hi << 4) | lo;
}
_
Patches currently in -mm which might be from andriy.shevchenko@linux.intel.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-09-11 19:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-11 19:42 [merged] lib-hexdump-return-einval-in-case-of-error-in-hex2bin.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.