git: 4cddd20e1ea8 - main - loader/ofw: Style(9) pass over return statements

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 20 May 2024 04:08:48 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=4cddd20e1ea8b9c622c72edfad3e64f70e9d56a9

commit 4cddd20e1ea8b9c622c72edfad3e64f70e9d56a9
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-05-19 21:14:43 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-20 04:05:43 +0000

    loader/ofw: Style(9) pass over return statements
    
    Make these consistent. Some files weren't even consistent with
    themselves. Make them all either return <space> ( <value> ); or
    return;
    
    Sponsored by:           Netflix
---
 stand/libofw/devicename.c  |  4 ++--
 stand/libofw/ofw_console.c | 10 +++++-----
 stand/libofw/ofw_copy.c    |  8 ++++----
 stand/libofw/ofw_module.c  |  2 +-
 stand/libofw/ofw_net.c     | 12 ++++++------
 stand/libofw/ofw_time.c    |  4 ++--
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/stand/libofw/devicename.c b/stand/libofw/devicename.c
index 5e3a789c13db..f6419632c6bc 100644
--- a/stand/libofw/devicename.c
+++ b/stand/libofw/devicename.c
@@ -101,12 +101,12 @@ ofw_common_parsedev(struct devdesc **dev, const char *devspec, const char **path
 	idev = malloc(sizeof(struct ofw_devdesc));
 	if (idev == NULL) {
 		printf("ofw_parsedev: malloc failed\n");
-		return ENOMEM;
+		return (ENOMEM);
 	};
 	strlcpy(idev->d_path, devspec, min(rem_path - devspec + 1,
 		sizeof(idev->d_path)));
 	*dev = &idev->dd;
 	if (path != NULL)
 		*path = rem_path;
-	return 0;
+	return (0);
 }
diff --git a/stand/libofw/ofw_console.c b/stand/libofw/ofw_console.c
index 4fbd43d3f612..75f9bfba0968 100644
--- a/stand/libofw/ofw_console.c
+++ b/stand/libofw/ofw_console.c
@@ -62,7 +62,7 @@ ofw_cons_probe(struct console *cp)
 static int
 ofw_cons_init(int arg)
 {
-	return 0;
+	return (0);
 }
 
 void
@@ -90,7 +90,7 @@ ofw_cons_getchar(void)
 	if (saved_char != -1) {
 		l = saved_char;
 		saved_char = -1;
-		return l;
+		return (l);
 	}
 
 	/* At least since version 4.0.0, QEMU became bug-compatible
@@ -109,12 +109,12 @@ ofw_cons_poll(void)
 	unsigned char ch;
 
 	if (saved_char != -1)
-		return 1;
+		return (1);
 
 	if (OF_read(stdin, &ch, 1) > 0) {
 		saved_char = ch;
-		return 1;
+		return (1);
 	}
 
-	return 0;
+	return (0);
 }
diff --git a/stand/libofw/ofw_copy.c b/stand/libofw/ofw_copy.c
index b855a5b41d96..17a46fe4e480 100644
--- a/stand/libofw/ofw_copy.c
+++ b/stand/libofw/ofw_copy.c
@@ -119,14 +119,14 @@ ofw_copyin(const void *src, vm_offset_t dest, const size_t len)
         }
 
         bcopy(src, (void *)dest, len);
-        return(len);
+        return (len);
 }
 
 ssize_t
 ofw_copyout(const vm_offset_t src, void *dest, const size_t len)
 {
 	bcopy((void *)src, dest, len);
-	return(len);
+	return (len);
 }
 
 ssize_t
@@ -143,7 +143,7 @@ ofw_readin(readin_handle_t fd, vm_offset_t dest, const size_t len)
 	buf = malloc(chunk);
 	if (buf == NULL) {
 		printf("ofw_readin: buf malloc failed\n");
-		return(0);
+		return (0);
 	}
 
         if (ofw_mapmem(dest, len)) {
@@ -166,5 +166,5 @@ ofw_readin(readin_handle_t fd, vm_offset_t dest, const size_t len)
 	}
 
 	free(buf);
-	return(len - resid);
+	return (len - resid);
 }
diff --git a/stand/libofw/ofw_module.c b/stand/libofw/ofw_module.c
index 8d56f6debbb6..4c1fe9cd279d 100644
--- a/stand/libofw/ofw_module.c
+++ b/stand/libofw/ofw_module.c
@@ -42,5 +42,5 @@ int
 ofw_autoload(void)
 {
     /* XXX Call some machdep autoload routine? */
-    return(0);
+    return (0);
 }
diff --git a/stand/libofw/ofw_net.c b/stand/libofw/ofw_net.c
index b4bcb7a00fe2..3418216a9836 100644
--- a/stand/libofw/ofw_net.c
+++ b/stand/libofw/ofw_net.c
@@ -80,13 +80,13 @@ static void		*dmabuf;
 static int
 ofwn_match(struct netif *nif, void *machdep_hint)
 {
-	return 1;
+	return (1);
 }
 
 static int
 ofwn_probe(struct netif *nif, void *machdep_hint)
 {
-	return 0;
+	return (0);
 }
 
 static ssize_t
@@ -123,7 +123,7 @@ ofwn_put(struct iodesc *desc, void *pkt, size_t len)
 	printf("netif_put: OF_write returned %d\n", rv);
 #endif
 
-	return rv;
+	return (rv);
 }
 
 static ssize_t
@@ -256,13 +256,13 @@ ofwn_getunit(const char *path)
 	for (i = 0; i < nofwninfo; i++) {
 		printf(">>> test =\t%s\n", ofwninfo[i].ofwn_path);
 		if (strcmp(path, ofwninfo[i].ofwn_path) == 0)
-			return i;
+			return (i);
 
 		if (strcmp(newpath, ofwninfo[i].ofwn_path) == 0)
-			return i;
+			return (i);
 	}
 
-	return -1;
+	return (-1);
 }
 #endif
 
diff --git a/stand/libofw/ofw_time.c b/stand/libofw/ofw_time.c
index c2da603bb52e..48372428ae29 100644
--- a/stand/libofw/ofw_time.c
+++ b/stand/libofw/ofw_time.c
@@ -35,7 +35,7 @@ time(time_t *tloc)
 	secs = OF_milliseconds() / 1000;
 	if (tloc)
 		*tloc = secs;
-	return secs;
+	return (secs);
 }
 
 time_t
@@ -43,7 +43,7 @@ getsecs(void)
 {
 	time_t	n = 0;
 	time(&n);
-	return n;
+	return (n);
 }
 
 void