Module Name: src Committed By: riastradh Date: Sun Mar 2 01:07:11 UTC 2025
Modified Files: src/sbin/efi: bootvar.c devpath2.c devpath3.c gptsubr.c main.c setvar.c showvar.c Log Message: efi(8): Break more overlong lines. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/efi/bootvar.c cvs rdiff -u -r1.4 -r1.5 src/sbin/efi/devpath2.c src/sbin/efi/gptsubr.c \ src/sbin/efi/main.c src/sbin/efi/showvar.c cvs rdiff -u -r1.5 -r1.6 src/sbin/efi/devpath3.c cvs rdiff -u -r1.3 -r1.4 src/sbin/efi/setvar.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/efi/bootvar.c diff -u src/sbin/efi/bootvar.c:1.2 src/sbin/efi/bootvar.c:1.3 --- src/sbin/efi/bootvar.c:1.2 Sun Mar 2 00:03:41 2025 +++ src/sbin/efi/bootvar.c Sun Mar 2 01:07:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: bootvar.c,v 1.2 2025/03/02 00:03:41 riastradh Exp $ */ +/* $NetBSD: bootvar.c,v 1.3 2025/03/02 01:07:11 riastradh Exp $ */ /* * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: bootvar.c,v 1.2 2025/03/02 00:03:41 riastradh Exp $"); +__RCSID("$NetBSD: bootvar.c,v 1.3 2025/03/02 01:07:11 riastradh Exp $"); #endif /* not lint */ #include <sys/queue.h> @@ -168,7 +168,8 @@ create_devpath_media_hd(const char *dev, pp->PartitionNumber = m->map_index; pp->PartitionStart = (uint64_t)m->map_start; pp->PartitionSize = (uint64_t)m->map_size; - memcpy(&pp->PartitionSignature, ent->ent_guid, sizeof(pp->PartitionSignature)); + memcpy(&pp->PartitionSignature, ent->ent_guid, + sizeof(pp->PartitionSignature)); pp->PartitionFormat = PARTITION_FORMAT_GPT; pp->SignatureType = SIGNATURE_TYPE_GUID; @@ -270,7 +271,8 @@ find_new_bootvar(efi_var_t **var_array, n = strlen(target); lastidx = -1; for (size_t i = 0; i < var_cnt; i++) { - idx = (int)strtou(var_array[i]->name + n, NULL, 16, 0, 0xffff, &rstatus); + idx = (int)strtou(var_array[i]->name + n, NULL, 16, 0, 0xffff, + &rstatus); if (rstatus != 0) err(EXIT_FAILURE, "strtou: %s", var_array[i]->name); Index: src/sbin/efi/devpath2.c diff -u src/sbin/efi/devpath2.c:1.4 src/sbin/efi/devpath2.c:1.5 --- src/sbin/efi/devpath2.c:1.4 Sun Mar 2 00:23:59 2025 +++ src/sbin/efi/devpath2.c Sun Mar 2 01:07:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: devpath2.c,v 1.4 2025/03/02 00:23:59 riastradh Exp $ */ +/* $NetBSD: devpath2.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $ */ /* * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: devpath2.c,v 1.4 2025/03/02 00:23:59 riastradh Exp $"); +__RCSID("$NetBSD: devpath2.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $"); #endif /* not lint */ #include <assert.h> @@ -174,8 +174,10 @@ devpath_acpi_acpiex(devpath_t *dp, devpa } else if (hidstr[0] == '\0' && cidstr[0] == '\0' && uidstr[0] != '\0') { assert(p->_HID != 0); - path->sz = easprintf(&path->cp, "AcpiExp(%s,%s,%s)", eisaid_to_str(p->_HID), - eisaid_to_str(p->_CID), uidstr); + path->sz = easprintf(&path->cp, "AcpiExp(%s,%s,%s)", + eisaid_to_str(p->_HID), + eisaid_to_str(p->_CID), + uidstr); } else { path->sz = easprintf(&path->cp, "ACPIEX(%s,%s,0x%x,%s,%s,%s)", Index: src/sbin/efi/gptsubr.c diff -u src/sbin/efi/gptsubr.c:1.4 src/sbin/efi/gptsubr.c:1.5 --- src/sbin/efi/gptsubr.c:1.4 Sun Mar 2 00:23:59 2025 +++ src/sbin/efi/gptsubr.c Sun Mar 2 01:07:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: gptsubr.c,v 1.4 2025/03/02 00:23:59 riastradh Exp $ */ +/* $NetBSD: gptsubr.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $ */ /* * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: gptsubr.c,v 1.4 2025/03/02 00:23:59 riastradh Exp $"); +__RCSID("$NetBSD: gptsubr.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -163,7 +163,8 @@ get_map_widths(gpt_t gpt) char ent_type[128]; memcpy(&gpt_uuid, ent->ent_type, sizeof(gpt_uuid)); - n = (uint)gpt_uuid_snprintf(ent_type, sizeof(ent_type), "%s", gpt_uuid); + n = (uint)gpt_uuid_snprintf(ent_type, sizeof(ent_type), + "%s", gpt_uuid); if (w.type_name < n) w.type_name = n; } @@ -254,7 +255,8 @@ show_map(map_t m, struct map_widths w) case MAP_TYPE_MBR: { struct mbr *mbr = m->map_data; - easprintf(&part_guid, "%02x%02x%02x%02x-0000-0000-0000-000000000000", + easprintf(&part_guid, + "%02x%02x%02x%02x-0000-0000-0000-000000000000", mbr->mbr_code[440], mbr->mbr_code[441], mbr->mbr_code[442], @@ -602,7 +604,8 @@ find_partition_pathname(const char *fnam DPRINTF("mount: %s\n", vfsbuf.f_mntonname); i = 0; - while (vfsbuf.f_mntonname[i] == rname[i] && vfsbuf.f_mntonname[i] != '\0') + while (vfsbuf.f_mntonname[i] == rname[i] && + vfsbuf.f_mntonname[i] != '\0') i++; if (vfsbuf.f_mntonname[i] != '\0') Index: src/sbin/efi/main.c diff -u src/sbin/efi/main.c:1.4 src/sbin/efi/main.c:1.5 --- src/sbin/efi/main.c:1.4 Sun Mar 2 00:03:41 2025 +++ src/sbin/efi/main.c Sun Mar 2 01:07:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.4 2025/03/02 00:03:41 riastradh Exp $ */ +/* $NetBSD: main.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $ */ /* * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: main.c,v 1.4 2025/03/02 00:03:41 riastradh Exp $"); +__RCSID("$NetBSD: main.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $"); #endif /* not lint */ #include <sys/efiio.h> @@ -304,7 +304,8 @@ main(int argc, char **argv) byte_order.b[1] != 3 || byte_order.b[2] != 2 || byte_order.b[3] != 1) { - errx(EXIT_FAILURE, "sorry: %s only runs on little-endian machines!", + errx(EXIT_FAILURE, + "sorry: %s only runs on little-endian machines!", getprogname()); } @@ -459,7 +460,8 @@ main(int argc, char **argv) case 'w': if (optarg != NULL) { opt.mbr_sig_write = MBR_SIG_WRITE_FORCE; - opt.mbr_sig = (uint32_t)estrtou(optarg, 0, 0, 0xffffffff); + opt.mbr_sig = (uint32_t)estrtou(optarg, 0, + 0, 0xffffffff); } else { opt.mbr_sig_write = MBR_SIG_WRITE_MAYBE; @@ -471,7 +473,8 @@ main(int argc, char **argv) case 'X': action = act_remove_bootorder; if (opt.csus != NULL) { - usage("Comma Separated Hex list already specified!\n"); + usage("Comma Separated Hex list" + " already specified!\n"); } opt.csus = estrdup(optarg); break; @@ -479,7 +482,8 @@ main(int argc, char **argv) case 'x': action = act_prefix_bootorder; if (opt.csus != NULL) { - usage("Comma Separated Hex list already specified!\n"); + usage("Comma Separated Hex list" + " already specified!\n"); } opt.csus = estrdup(optarg); break; @@ -579,10 +583,12 @@ main(int argc, char **argv) if (opt.regexp != NULL) break; - if (opt.b_flag) - easprintf(&opt.regexp, "^%s%04X$", opt.target, opt.bootnum); - else + if (opt.b_flag) { + easprintf(&opt.regexp, "^%s%04X$", + opt.target, opt.bootnum); + } else { easprintf(&opt.regexp, "^%s", opt.target); + } break; } @@ -613,7 +619,8 @@ main(int argc, char **argv) /* * Get a new variable name */ - bootnum = (uint16_t)find_new_bootvar(var_array, var_cnt, opt.target); + bootnum = (uint16_t)find_new_bootvar(var_array, var_cnt, + opt.target); easprintf(&v.name, "%s%04X", opt.target, bootnum); if (!opt.quiet) @@ -632,7 +639,8 @@ main(int argc, char **argv) * Setup the efi_ioc data section */ v.ev.data = make_bootvar_data(opt.device, opt.partnum, - attrib, opt.label, opt.loader, opt.opt_fname, &v.ev.datasize); + attrib, opt.label, opt.loader, opt.opt_fname, + &v.ev.datasize); #if 1 if (!opt.quiet) { /* Index: src/sbin/efi/showvar.c diff -u src/sbin/efi/showvar.c:1.4 src/sbin/efi/showvar.c:1.5 --- src/sbin/efi/showvar.c:1.4 Sun Mar 2 00:03:41 2025 +++ src/sbin/efi/showvar.c Sun Mar 2 01:07:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: showvar.c,v 1.4 2025/03/02 00:03:41 riastradh Exp $ */ +/* $NetBSD: showvar.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $ */ /* * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: showvar.c,v 1.4 2025/03/02 00:03:41 riastradh Exp $"); +__RCSID("$NetBSD: showvar.c,v 1.5 2025/03/02 01:07:11 riastradh Exp $"); #endif /* not lint */ #include <sys/efiio.h> @@ -242,6 +242,7 @@ show_key_data(efi_var_t *v, bool dbg) uint8_t *bp; } u = { .bp = v->ev.data, }; char buf[256], c, *cp, *desc; + uint i; printf("%s:", v->name); @@ -280,7 +281,7 @@ show_key_data(efi_var_t *v, bool dbg) if (c != '\0') *cp = c; /* restore the buffer */ - for (uint i = 0; i < u.ko->KeyData.Options.InputKeyCount; i++) + for (i = 0; i < u.ko->KeyData.Options.InputKeyCount; i++) printf(" {%04x, %04x}", u.ko->Keys[i].ScanCode, u.ko->Keys[i].UnicodeChar); printf("\n"); @@ -289,7 +290,7 @@ show_key_data(efi_var_t *v, bool dbg) printf(" KeyData: %s\n", buf); printf(" BootOptionCrc: 0x%08x\n", u.ko->BootOptionCrc); printf(" BootOption: Boot%04X\n", u.ko->BootOption); - for (uint i = 0; i < u.ko->KeyData.Options.InputKeyCount; i++) { + for (i = 0; i < u.ko->KeyData.Options.InputKeyCount; i++) { printf(" Keys[%u].ScanCode: 0x%04x\n", i, u.ko->Keys[i].ScanCode); printf(" Keys[%u].UnicodeChar: 0x%04x\n", i, Index: src/sbin/efi/devpath3.c diff -u src/sbin/efi/devpath3.c:1.5 src/sbin/efi/devpath3.c:1.6 --- src/sbin/efi/devpath3.c:1.5 Sun Mar 2 00:23:59 2025 +++ src/sbin/efi/devpath3.c Sun Mar 2 01:07:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: devpath3.c,v 1.5 2025/03/02 00:23:59 riastradh Exp $ */ +/* $NetBSD: devpath3.c,v 1.6 2025/03/02 01:07:11 riastradh Exp $ */ /* * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: devpath3.c,v 1.5 2025/03/02 00:23:59 riastradh Exp $"); +__RCSID("$NetBSD: devpath3.c,v 1.6 2025/03/02 01:07:11 riastradh Exp $"); #endif /* not lint */ #include <arpa/inet.h> @@ -578,7 +578,8 @@ devpath_msg_vendor(devpath_t *dp, devpat vt = devpath_msg_vendor_type(&p->GUID); if (vt == NULL) { - path->sz = easprintf(&path->cp, "VenMsg(%s,%s)", uuid_str, data_str); + path->sz = easprintf(&path->cp, "VenMsg(%s,%s)", + uuid_str, data_str); } else if (vt->fn == NULL) { assert(vt->name != NULL); @@ -963,7 +964,8 @@ devpath_msg_usbwwid(devpath_t *dp, devpa } else { size_t sz = p->hdr.Length - sizeof(*p); - serialnum = ucs2_to_utf8((uint16_t *)p->SerialNum, sz, NULL, NULL); + serialnum = ucs2_to_utf8((uint16_t *)p->SerialNum, sz, NULL, + NULL); } path->sz = easprintf(&path->cp, "UsbWwid(0x%04x,0x%04x,0x%02x,%s)", @@ -1122,7 +1124,8 @@ devpath_msg_iscsi(devpath_t *dp, devpath if (dbg != NULL) { char liopt[256]; - snprintb(liopt, sizeof(liopt), LOGIN_OPTION_BITS, p->LoginOptions); + snprintb(liopt, sizeof(liopt), LOGIN_OPTION_BITS, + p->LoginOptions); dbg->sz = easprintf(&dbg->cp, DEVPATH_FMT_HDR DEVPATH_FMT(Protocol: 0x%04x(%s)\n) @@ -1358,7 +1361,8 @@ devpath_msg_bluetooth(devpath_t *dp, dev } __packed *p = (void *)dp; __CTASSERT(sizeof(*p) == 10); - path->sz = easprintf(&path->cp, "Bluetooth(%02x:%02x:%02x:%02x:%02x:%02x)", + path->sz = easprintf(&path->cp, + "Bluetooth(%02x:%02x:%02x:%02x:%02x:%02x)", p->bdaddr[0], p->bdaddr[1], p->bdaddr[2], p->bdaddr[3], p->bdaddr[4], p->bdaddr[5]); Index: src/sbin/efi/setvar.c diff -u src/sbin/efi/setvar.c:1.3 src/sbin/efi/setvar.c:1.4 --- src/sbin/efi/setvar.c:1.3 Sun Mar 2 00:23:59 2025 +++ src/sbin/efi/setvar.c Sun Mar 2 01:07:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: setvar.c,v 1.3 2025/03/02 00:23:59 riastradh Exp $ */ +/* $NetBSD: setvar.c,v 1.4 2025/03/02 01:07:11 riastradh Exp $ */ /* * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: setvar.c,v 1.3 2025/03/02 00:23:59 riastradh Exp $"); +__RCSID("$NetBSD: setvar.c,v 1.4 2025/03/02 01:07:11 riastradh Exp $"); #endif /* not lint */ #include <sys/efiio.h> @@ -67,7 +67,8 @@ parse_csus(const char *csus, uint16_t ** for (;;) { data[n++] = strtous(p, &q, base); if (*q != ',' && *q != '\0') - errx(EXIT_FAILURE, "invalid CSUS string: '%s' (at %s)\n", + errx(EXIT_FAILURE, "invalid CSUS string:" + " '%s' (at %s)\n", csus, p); if (*q == '\0') break;