git: 06a894ca9b41 - main - stand/uboot: Remove unneeded nitems definition
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 May 2025 15:33:28 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=06a894ca9b413757e786eb7999fcf4c61424d272
commit 06a894ca9b413757e786eb7999fcf4c61424d272
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-05-26 03:39:02 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-05-26 15:30:36 +0000
stand/uboot: Remove unneeded nitems definition
Also, remove the trailing white space that was introduced in the same
commit as the nitems fallback definition.
Sponsored by: Netflix
---
stand/uboot/main.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/stand/uboot/main.c b/stand/uboot/main.c
index 5a896959122e..3b0f0bc04dd8 100644
--- a/stand/uboot/main.c
+++ b/stand/uboot/main.c
@@ -35,10 +35,6 @@
#include "glue.h"
#include "libuboot.h"
-#ifndef nitems
-#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
-#endif
-
#ifndef HEAP_SIZE
#define HEAP_SIZE (2 * 1024 * 1024)
#endif
@@ -50,7 +46,7 @@ int devs_no;
uintptr_t uboot_heap_start;
uintptr_t uboot_heap_end;
-struct device_type {
+struct device_type {
const char *name;
int type;
} device_types[] = {
@@ -336,7 +332,7 @@ get_load_device(int *type, int *unit, int *slice, int *partition)
*unit = -1;
*slice = D_SLICEWILD;
*partition = D_PARTWILD;
-}
+}
static void
print_disk_probe_info(void)
@@ -365,7 +361,7 @@ print_disk_probe_info(void)
}
static int
-probe_disks(int devidx, int load_type, int load_unit, int load_slice,
+probe_disks(int devidx, int load_type, int load_unit, int load_slice,
int load_partition)
{
int open_result, unit;
@@ -518,7 +514,7 @@ main(int argc, char **argv)
if ((load_type == DEV_TYP_NONE || (load_type & DEV_TYP_STOR)) &&
strcmp(devsw[i]->dv_name, "disk") == 0) {
- if (probe_disks(i, load_type, load_unit, load_slice,
+ if (probe_disks(i, load_type, load_unit, load_slice,
load_partition) == 0)
break;
}
@@ -634,7 +630,7 @@ handle_uboot_env_var(enum ubenv_action action, const char * var)
* import the uboot variable ubname into the loader variable ldname,
* otherwise the historical behavior is to import to uboot.ubname.
*/
- if (action == UBENV_IMPORT) {
+ if (action == UBENV_IMPORT) {
len = strcspn(var, "=");
if (len == 0) {
printf("name cannot start with '=': '%s'\n", var);