From nobody Wed Mar 02 21:57:36 2022 X-Original-To: dev-commits-src-all@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 B916119E0DA8; Wed, 2 Mar 2022 21:57:38 +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 4K87Jd38nkz3KTg; Wed, 2 Mar 2022 21:57:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646258257; 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=o8QO3IXNh6XIW80XUr8BpLKm4EQfcfrpX4FjoRNSwbo=; b=pnwB8xe4SQ0/d+ozRVQWTh9D3DAvHfFoWiOQ2wPCAMSq6C+MISfRguJmKbKAKJ4OJA6Jdi CzxFjrss3I/iGLZULj4O3ONp+V6p303iAoVK71GV6UlpxnytVdCK5PZqAX4XlWVXIUz142 r2pDy+zQ/nDOtqelvwtpq5zoFFa8ui6DYCKO9oMdqYOcjzmlDekUv7Zx0b7dCD62YC1kEi 7EeIgJTPc/jGnGusbcn7KpJie+ViMKbjKWsr9furYekKp3kQJHQ6JWGh7aoEn3s8z6hV/q UsX1ssGqAt5tSF5XTIWDz0Vm1WSUX6kpu2bb0dH2Cypm3/4Qmaw6BXPIeyrQuQ== 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 5DC91346D; Wed, 2 Mar 2022 21:57:36 +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 222Lva2d065444; Wed, 2 Mar 2022 21:57:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 222LvaFI065443; Wed, 2 Mar 2022 21:57:36 GMT (envelope-from git) Date: Wed, 2 Mar 2022 21:57:36 GMT Message-Id: <202203022157.222LvaFI065443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric van Gyzen Subject: git: d8d0ac7b5d73 - stable/13 - efivar: use bool for booleans List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d8d0ac7b5d735f412c1d1ed7d5be0ab2ecffd1d5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646258257; 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=o8QO3IXNh6XIW80XUr8BpLKm4EQfcfrpX4FjoRNSwbo=; b=ZKkDS680nPaKBOBJrPAbjZoAJ2+RmoDy9xwr+JbOec/046ew+NT1SW6RnPu38g9AJoYNj+ Oe2HSBeIlFjSINyCjlIIP8sPcNxwGuoal/oOTS9XVgMSox9SHaMV1NAif8yYaGvbhuG8D5 Zkm5k3TvVbS2B/lzxZBt1/8fPjm5HVN2LkqpSdJb1yGh8LuweZUrC2FgPEgg3sGEIpYpUC OEGSvTF+eto52ALK8VvtdwC2hgFe38Q9w6Om4iCPVMi1AhBBWZptCHG1/z+GgLXjZj8+t7 Nh4evdNX6NQ3QG+j/YcdCF8TAd3l5GroD7TMxYTrkUmHuqVbin++w07n4ZbQcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646258257; a=rsa-sha256; cv=none; b=nLqkN1bWAcGhJwexvAbxaXF8269RW35ECLkNWkFxjiP/+zehj29t+uG2muHjPVC2e1m03w A5yFfiO6YsrKvK+TXdCi0cqhSlX0p/mgNP8xVjBeZi7Cv2jHpZdbH42eO4Va7bpdfs9Xid vy+YlJ0rB9DlKhMiBl+wu6YOlJA16orlyE53i+Bz0PHE60tj6vnGZOjQv0+wXreGC4sP55 ZVYSNd0Sy8pc/EBskf6J5CQiJcQtVYoTiVzr5HJP2NcdLniBMsI17uW4ARVgGNuvhWz+y0 VQsvJji/y9tUMv2GsmuvkUZPj6aupifJasadsYXswAW6gfoiPZDgCJUXsw7cCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=d8d0ac7b5d735f412c1d1ed7d5be0ab2ecffd1d5 commit d8d0ac7b5d735f412c1d1ed7d5be0ab2ecffd1d5 Author: Warner Losh AuthorDate: 2021-04-09 22:35:50 +0000 Commit: Eric van Gyzen CommitDate: 2022-03-02 21:56:31 +0000 efivar: use bool for booleans Rather than int flags we ++, use booleans for all command line args. No functional change intended. Reviewed by: markj@ Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D29621 (cherry picked from commit 066b096d13a150e802c7142602d821c0b494487b) --- usr.sbin/efivar/efivar.c | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/usr.sbin/efivar/efivar.c b/usr.sbin/efivar/efivar.c index 2fdf0e4d09b8..eb9a6e0257c8 100644 --- a/usr.sbin/efivar/efivar.c +++ b/usr.sbin/efivar/efivar.c @@ -70,9 +70,8 @@ static struct option longopts[] = { }; -static int aflag, Aflag, bflag, dflag, Dflag, gflag, Hflag, Nflag, - lflag, Lflag, Rflag, wflag, pflag, uflag, load_opt_flag; -static bool quiet; +static bool aflag, Aflag, bflag, dflag, Dflag, gflag, Hflag, Nflag, + lflag, Lflag, Rflag, wflag, pflag, uflag, load_opt_flag, quiet; static char *varname; static char *fromfile; static u_long attrib = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; @@ -316,58 +315,58 @@ parse_args(int argc, char **argv) longopts, NULL)) != -1) { switch (ch) { case 'a': - aflag++; + aflag = true; break; case 'A': - Aflag++; + Aflag = true; break; case 'b': - bflag++; + bflag = true; break; case 'd': - dflag++; + dflag = true; break; case 'D': - Dflag++; + Dflag = true; break; case 'g': - gflag++; + gflag = true; break; case 'H': - Hflag++; + Hflag = true; break; case 'l': - lflag++; + lflag = true; break; case 'L': - Lflag++; + Lflag = true; break; case 'n': varname = optarg; break; case 'N': - Nflag++; + Nflag = true; break; case 'O': - load_opt_flag++; + load_opt_flag = true; break; case 'p': - pflag++; + pflag = true; break; case 'q': quiet = true; break; case 'R': - Rflag++; + Rflag = true; break; case 't': attrib = strtoul(optarg, NULL, 16); break; case 'u': - uflag++; + uflag = true; break; case 'w': - wflag++; + wflag = true; break; case 'f': free(fromfile); @@ -386,13 +385,13 @@ parse_args(int argc, char **argv) if (argc == 1) varname = argv[0]; - if (aflag + Dflag + wflag > 1) { + if ((int)aflag + (int)Dflag + (int)wflag > 1) { warnx("Can only use one of -a (--append), " "-D (--delete) and -w (--write)"); usage(); } - if (aflag + Dflag + wflag > 0 && varname == NULL) { + if ((int)aflag + (int)Dflag + (int)wflag > 0 && varname == NULL) { warnx("Must specify a variable for -a (--append), " "-D (--delete) or -w (--write)"); usage(); @@ -407,13 +406,13 @@ parse_args(int argc, char **argv) else if (Lflag) print_known_guid(); else if (fromfile) { - Nflag = 1; + Nflag = true; print_var(NULL, NULL); } else if (varname) { - pflag++; + pflag = true; print_variable(varname); } else if (argc > 0) { - pflag++; + pflag = true; for (i = 0; i < argc; i++) print_variable(argv[i]); } else