From nobody Thu Jul 28 04:32:00 2022 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 4Ltd5r4bKBz4XsTl; Thu, 28 Jul 2022 04:32:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ltd5r3n9Sz3C0l; Thu, 28 Jul 2022 04:32:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658982720; 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=VQbPGcsH5Ykr6MjARnUvXgGbme/LmayRb4uefrgN7fU=; b=dTrAwraIY8uvUUZNeOroSHmyjhbawmpgWJ6vA4UYV32KxxxCG+3eNAD843cSaf+gkR8dbX uadNnelhasSvFeZxhLuVfzm/C+1MkZ2if3uD/6J1bmV1BjIvMOfarRh6FHHlnV0G59NNuj 9i7yw3rEl/o9BeDsU1UIQBRL0gV7YRDomuCSe+DKkiYiJphB30tJYCRVk7XCgmN7s6eWCR emJ6ZgomZlLHW/ZsQ2kAOB36kTuOZvNZev2/wmYnigFHSyjJNO7JJ62FuSUGb3ICN/Ff7H lLPDj1xMW8u7hUQhb/WIiIZ5g8vebe8TgzEzwZ4jrNhyAdjLdDwl7maye27ifg== 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 4Ltd5r2qldzjtN; Thu, 28 Jul 2022 04:32:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26S4W0ig014563; Thu, 28 Jul 2022 04:32:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26S4W0nj014562; Thu, 28 Jul 2022 04:32:00 GMT (envelope-from git) Date: Thu, 28 Jul 2022 04:32:00 GMT Message-Id: <202207280432.26S4W0nj014562@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: 065cbc77076e - main - kboot: Do a style(9) pass on kbootfdt.c 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 065cbc77076ec8d38385406deefa8331bc2432f5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658982720; 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=VQbPGcsH5Ykr6MjARnUvXgGbme/LmayRb4uefrgN7fU=; b=K8b9p+ZkpyFSmkfXt59nr20IMXYYAMsy5piOTMZ0EP1SVMIH45Mbw+6Kyu69coFjeTE37U 29YaUmQ4sGgbaMUzProyhYA8CX/jNCsdcEpp1sB6yJxpy+yQQTnaZfU43DomPr3O2IT6uA AfGM5x2KnqJpMCCWNZy+MRFZSP8RAKCbzUBLLUJSK6Xl+lWFLqJPWkv/jjLecHbjoK0Hkg iTCnds4BZOqdfN7VYF8/IQcD7adGgX9kreg8d4qP0slO48g34H9NT38UeMLmms+9uUbGqq AQ1VzapnWr0geadfQ4M6DfAUZ1teMLRUCo2oh7orhFJsZaI+2VwO+l9o4W3scA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658982720; a=rsa-sha256; cv=none; b=BQdSEtNIbmD8r5PMeiPK5igDfW7BzkAx//LYMpxjJ3oV3iGib/cfLvJhEgi/mu84i2SRNC +CtlqgyrYphrlv0lyi6AZk5HCDMXUs1vyDTz0UUooJmTt4W2zhAtLyC8zzbP9b1dSc/QtS FJ3Bjl9E6z43P0rjFLpetxORKdLM3vi6/F2vImEqy9S+b7XHFivyGzUrqggaLLrM071MXH V+rjwrnqLKiFYMMNfX+pUba+YXiTHtZ6QX+cQEkP2ntWxfVqBjcP2ekPPB7HHL954w18Nr /+kGQUAeu45r5Eg3eDRDmP0AFvkxOsKEfzE2b3U5gDT0dcOkomGAjVCtpiT1Yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=065cbc77076ec8d38385406deefa8331bc2432f5 commit 065cbc77076ec8d38385406deefa8331bc2432f5 Author: Warner Losh AuthorDate: 2022-07-28 04:07:52 +0000 Commit: Warner Losh CommitDate: 2022-07-28 04:29:27 +0000 kboot: Do a style(9) pass on kbootfdt.c Mostly just properly indent. Sponsored by: Netflix --- stand/kboot/kbootfdt.c | 68 +++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/stand/kboot/kbootfdt.c b/stand/kboot/kbootfdt.c index 14bc94326fe6..5e0ef9ea3068 100644 --- a/stand/kboot/kbootfdt.c +++ b/stand/kboot/kbootfdt.c @@ -53,44 +53,44 @@ add_node_to_fdt(void *buffer, const char *path, int fdt_offset) fd = host_open(path, O_RDONLY, 0); while (1) { - dentsize = host_getdents(fd, dents, sizeof(dents)); - if (dentsize <= 0) - break; - for (dent = (struct host_dent *)dents; - (char *)dent < dents + dentsize; - dent = (struct host_dent *)((void *)dent + dent->d_reclen)) { - sprintf(subpath, "%s/%s", path, dent->d_name); - if (strcmp(dent->d_name, ".") == 0 || - strcmp(dent->d_name, "..") == 0) - continue; - d_type = *((char *)(dent) + dent->d_reclen - 1); - if (d_type == 4 /* DT_DIR */) { - child_offset = fdt_add_subnode(buffer, fdt_offset, - dent->d_name); - if (child_offset < 0) { - printf("Error %d adding node %s/%s, skipping\n", - child_offset, path, dent->d_name); + dentsize = host_getdents(fd, dents, sizeof(dents)); + if (dentsize <= 0) + break; + for (dent = (struct host_dent *)dents; + (char *)dent < dents + dentsize; + dent = (struct host_dent *)((void *)dent + dent->d_reclen)) { + sprintf(subpath, "%s/%s", path, dent->d_name); + if (strcmp(dent->d_name, ".") == 0 || + strcmp(dent->d_name, "..") == 0) continue; - } + d_type = *((char *)(dent) + dent->d_reclen - 1); + if (d_type == 4 /* DT_DIR */) { + child_offset = fdt_add_subnode(buffer, fdt_offset, + dent->d_name); + if (child_offset < 0) { + printf("Error %d adding node %s/%s, skipping\n", + child_offset, path, dent->d_name); + continue; + } - add_node_to_fdt(buffer, subpath, child_offset); - } else { - propbuf = malloc(1024); - proplen = 0; - pfd = host_open(subpath, O_RDONLY, 0); - if (pfd > 0) { - proplen = host_read(pfd, propbuf, 1024); - host_close(pfd); + add_node_to_fdt(buffer, subpath, child_offset); + } else { + propbuf = malloc(1024); + proplen = 0; + pfd = host_open(subpath, O_RDONLY, 0); + if (pfd > 0) { + proplen = host_read(pfd, propbuf, 1024); + host_close(pfd); + } + error = fdt_setprop(buffer, fdt_offset, dent->d_name, + propbuf, proplen); + free(propbuf); + if (error) + printf("Error %d adding property %s to " + "node %d\n", error, dent->d_name, + fdt_offset); } - error = fdt_setprop(buffer, fdt_offset, dent->d_name, - propbuf, proplen); - free(propbuf); - if (error) - printf("Error %d adding property %s to " - "node %d\n", error, dent->d_name, - fdt_offset); } - } } host_close(fd);