git: b23f20eb0fec - stable/13 - kboot: Do a style(9) pass on kbootfdt.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Jan 2023 22:11:32 UTC
The branch stable/13 has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=b23f20eb0fec72af500d8ad14cd0ae8ae3b15300
commit b23f20eb0fec72af500d8ad14cd0ae8ae3b15300
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-28 04:07:52 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:28 +0000
kboot: Do a style(9) pass on kbootfdt.c
Mostly just properly indent.
Sponsored by: Netflix
(cherry picked from commit 065cbc77076ec8d38385406deefa8331bc2432f5)
---
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);