From nobody Mon May 26 15:33:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4b5ftJ2WlJz5wBGK; Mon, 26 May 2025 15:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b5ftJ23Hyz42pQ; Mon, 26 May 2025 15:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748273608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z2Y03udtQrZvr58RKUOy5E7IdD+gARYWzhQBHJ5hOSg=; b=ZaReJL7UK8Ua3uBEh8U8gH2e9Z1eXTzARkR/iHqCBMb4zFBZtw24Gboy73nZT4K377S1cD /0wXF8SxRy4kN7umBGPTnQVVkNILTEzvs04mfTh5K5+0N3iQTn8VsMpW3eLrfTAN+Mel4v V35/m10gHIxRN3xlHovEuKfss8Ff2nbDTqtTv1LDPV3/SR5YT8qDFiYxLPr3EduOC24+zI aaCaA0N1O8+O2UZF8T2cbfHoPBtmkMZJZViKHC86iA4JVU/kV2ZIPKNEYs7cAcJY+FJ/Sq 6mRmpeQDxwqQVgwpWB16/QITey8933awEL7/4uJHKSuSZLffQ9HWNxc7zrI83w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748273608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z2Y03udtQrZvr58RKUOy5E7IdD+gARYWzhQBHJ5hOSg=; b=Oj3o3tvQsmmzdoGHxDnxOksrHZaULoAnTPSw2JLiZDHZOLy1prCSOxsdtaLhQkMRbCR5jZ 7sQv8FSIlw6A7gg4is8zG+nfFP1INtJhHsPMGQFIEGA4zFv/ZC7iZ4lO1VD3biAaW5/qoo 6s1p/KcWwJ4hOOF7Q+0ztAmSVpTJP/DTX6fNfkOKROMuH+Z/U90UP8qpbRf6J8w95zRWPr LxA3GxUuy4bDIjHSDaIbEI+c+IPVkPUaM0hguQ30gZUayFkUrJt/XJZiQYMmUy1z6OJ8lS n4ECEnFuWcLnzz36LBXy8g+IdSsQcWRdAOMXOMICVA2RwnPj9X3/RQV0OqUzeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748273608; a=rsa-sha256; cv=none; b=wscTMVDDjJQtZ6KrKqjBDUK699YDlfw7LI4OLZwG889ZYx7c6BWM4+FTtLkEoCYmRg5u5U dkPm6flWr8Azst+19mnF7ZpghBs3xOqdFusQin4JXafH7MrZwL5dp+zi5U747vf/GUF9Q6 U8djJBZKI3VkQ0PsR2WXPCz/0KQ5AoNeUCbfx8+fdgVKDO4Oyr1nxO1brhcyuRo7g/krQn AOhDfPpEBB0MBZQfmJi2pBsSr5pMvAOjQN6Br0KStpxMYOcRQvraxsbM4VWusSIGs0PLpC pqm2hYuLsHs6g0XM/+CTD7J8zk6YMMEQzzBwJcc7OdTv/dzmpRlXGcBQJ9QJBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b5ftJ1fn1z1BxX; Mon, 26 May 2025 15:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54QFXSfD044902; Mon, 26 May 2025 15:33:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54QFXSrg044899; Mon, 26 May 2025 15:33:28 GMT (envelope-from git) Date: Mon, 26 May 2025 15:33:28 GMT Message-Id: <202505261533.54QFXSrg044899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 06a894ca9b41 - main - stand/uboot: Remove unneeded nitems definition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06a894ca9b413757e786eb7999fcf4c61424d272 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=06a894ca9b413757e786eb7999fcf4c61424d272 commit 06a894ca9b413757e786eb7999fcf4c61424d272 Author: Warner Losh AuthorDate: 2025-05-26 03:39:02 +0000 Commit: Warner Losh 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);