Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Avoid parentheses in return statements (KNF)
details: https://anonhg.NetBSD.org/src/rev/494d092bcc95
branches: trunk
changeset: 365113:494d092bcc95
user: khorben <khorben%NetBSD.org@localhost>
date: Wed Aug 01 12:25:50 2018 +0000
description:
Avoid parentheses in return statements (KNF)
NFCI.
Thanks skrll@ for the heads-up!
diffstat:
sys/dev/usb/if_umb.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diffs (104 lines):
diff -r 582d7b30d4a5 -r 494d092bcc95 sys/dev/usb/if_umb.c
--- a/sys/dev/usb/if_umb.c Wed Aug 01 12:09:01 2018 +0000
+++ b/sys/dev/usb/if_umb.c Wed Aug 01 12:25:50 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_umb.c,v 1.1 2018/07/31 16:44:29 khorben Exp $ */
+/* $NetBSD: if_umb.c,v 1.2 2018/08/01 12:25:50 khorben Exp $ */
/* $OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
/*
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.1 2018/07/31 16:44:29 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.2 2018/08/01 12:25:50 khorben Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -2736,13 +2736,13 @@
{
switch (af) {
case AF_INET:
- return (inet_ntop4(src, dst, (size_t)size));
+ return inet_ntop4(src, dst, (size_t)size);
#ifdef INET6
case AF_INET6:
- return (inet_ntop6(src, dst, (size_t)size));
+ return inet_ntop6(src, dst, (size_t)size);
#endif /* INET6 */
default:
- return (NULL);
+ return NULL;
}
/* NOTREACHED */
}
@@ -2767,10 +2767,10 @@
l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
src[0], src[1], src[2], src[3]);
if (l <= 0 || l >= size) {
- return (NULL);
+ return NULL;
}
strlcpy(dst, tmp, size);
- return (dst);
+ return dst;
}
#ifdef INET6
@@ -2843,7 +2843,7 @@
i < (best.base + best.len)) {
if (i == best.base) {
if (tp + 1 >= ep)
- return (NULL);
+ return NULL;
*tp++ = ':';
}
continue;
@@ -2851,39 +2851,39 @@
/* Are we following an initial run of 0x00s or any real hex? */
if (i != 0) {
if (tp + 1 >= ep)
- return (NULL);
+ return NULL;
*tp++ = ':';
}
/* Is this address an encapsulated IPv4? */
if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
if (!inet_ntop4(src+12, tp, (size_t)(ep - tp)))
- return (NULL);
+ return NULL;
tp += strlen(tp);
break;
}
advance = snprintf(tp, ep - tp, "%x", words[i]);
if (advance <= 0 || advance >= ep - tp)
- return (NULL);
+ return NULL;
tp += advance;
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) {
if (tp + 1 >= ep)
- return (NULL);
+ return NULL;
*tp++ = ':';
}
if (tp + 1 >= ep)
- return (NULL);
+ return NULL;
*tp++ = '\0';
/*
* Check for overflow, copy, and we're done.
*/
if ((size_t)(tp - tmp) > size) {
- return (NULL);
+ return NULL;
}
strlcpy(dst, tmp, size);
- return (dst);
+ return dst;
}
#endif /* INET6 */
Home |
Main Index |
Thread Index |
Old Index