From nobody Sat Sep 21 11:26:25 2024 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 4X9n5G0dX2z5VqV5; Sat, 21 Sep 2024 11:26:26 +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 4X9n5F5gpbz4p84; Sat, 21 Sep 2024 11:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917985; 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=lIy+IjnwA7IKFAwC+zE6ksjtGQAcjGZkChklv1H7AXM=; b=JyQKzeGgP8s2vvMHbwj0eDyO2u/uu5M7ouVsnokVuXUZ8m+WAmjA4MX8kNcu7qhNCl0tft 3nFFm4HkbjNCD2nIwh6we1wBcczw83SiwZql/K2sqp1OxpVI7iXeg7dLq9QlgN0ynyGb0w AmBMIw6Pn8pMfdXXeSE2vdE5U6ZYp4cKFxAZqiNgSHbvKDt6rY+Xp6tCmH4r84o+RkWMTc GcvAZm2RVKJF02hJ+cMv7Bbjz79z7GxjS5BedmHgY/eew5PFktqf0z54hqqxBVKjqbjtgg RhC7K1yTrZgI25ZAjfq26XLYgoy6ITltqXf5Gh1y/Bcw9/dbvkwK54Emf6eNkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917985; a=rsa-sha256; cv=none; b=yNeN2CylChfBaqX57sIGzwTiRz/PlYzkMq9vfdS3civ85o2lAia01HIjrrmlE9uviSAG6q FyUIOjaWrP6Winw/ixZ3zAFE4LhD2SliP7xlEy8vo3RLs+LY2hv9YannQOBDKp/OXcL1fG YW1uTcj7VJtPT6VKln+tmWD6vXldI8mKVTtpeZMlsCVKXlWUOWr7eOU+mUYe22iRkIJb3E hwMWWCRyGIotp6U16xi+AAM3aHM+z138vCX7gmkuKIcYyLgxNvnGaIIn+u+Pnkeu4zKHSa wzfY3NjqLP7tl9wp1tC5nk5gpDvnXzwAp6VEdmAWHCwB+Jdu5EWaPc7p4vz99g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917985; 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=lIy+IjnwA7IKFAwC+zE6ksjtGQAcjGZkChklv1H7AXM=; b=klBgIg4ev74jM2WyoD53FSNR28EkFGSQ6k3QAJgmR3c9Xc8F72NJckPVO7hz3PggTESJYW Kj4+/ebgpVaNMmG5Q2cSkUOIS+MT+SmMV5vg2zxrfFkIz17WZp4DiR/99Z6UjZjF8CfCKA 2Bv/spdQwqWQ3L1JegdzjeQLpu6jLAeFnbz1j7zYeJCfg0ucMTARKfAtGct3KmkXFtwKDy wBbNskRlf4o9+kCZBCgbJ/kWj4Yk1YMHC59y8Uv9CurkRW8PActAAF89/ll7vmFwcCf9/U RGu9obp9XqK+5Ufe0DRi88WD8VD81fjPOJOc1uk5lNejltpdb5odizDR779QAQ== 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 4X9n5F54p9zX29; Sat, 21 Sep 2024 11:26:25 +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 48LBQPkk040370; Sat, 21 Sep 2024 11:26:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQP4m040367; Sat, 21 Sep 2024 11:26:25 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:25 GMT Message-Id: <202409211126.48LBQP4m040367@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: a698c15a41af - main - loader: remove unneeded variable 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: a698c15a41afca19f87e11d4f8ce5664f992673b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a698c15a41afca19f87e11d4f8ce5664f992673b commit a698c15a41afca19f87e11d4f8ce5664f992673b Author: Ahmad Khalifa AuthorDate: 2024-08-12 10:01:07 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:16 +0000 loader: remove unneeded variable Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1381 --- stand/efi/loader/copy.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index e5c950d75f37..3e466e875af8 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -220,11 +220,10 @@ command_copy_staging(int argc, char *argv[]) [COPY_STAGING_DISABLE] = "disable", [COPY_STAGING_AUTO] = "auto", }; - int prev, res; + int prev; - res = CMD_OK; if (argc > 2) { - res = CMD_ERROR; + return (CMD_ERROR); } else if (argc == 2) { prev = copy_staging; if (strcmp(argv[1], "enable") == 0) @@ -235,9 +234,9 @@ command_copy_staging(int argc, char *argv[]) copy_staging = COPY_STAGING_AUTO; else { printf("usage: copy_staging enable|disable|auto\n"); - res = CMD_ERROR; + return (CMD_ERROR); } - if (res == CMD_OK && prev != copy_staging) { + if (prev != copy_staging) { printf("changed copy_staging, unloading kernel\n"); unload(); efi_copy_free(); @@ -246,7 +245,7 @@ command_copy_staging(int argc, char *argv[]) } else { printf("copy staging: %s\n", mode[copy_staging]); } - return (res); + return (CMD_OK); } COMMAND_SET(copy_staging, "copy_staging", "copy staging", command_copy_staging); #endif @@ -256,18 +255,16 @@ command_staging_slop(int argc, char *argv[]) { char *endp; u_long new, prev; - int res; - res = CMD_OK; if (argc > 2) { - res = CMD_ERROR; + return (CMD_ERROR); } else if (argc == 2) { new = strtoul(argv[1], &endp, 0); if (*endp != '\0') { printf("invalid slop value\n"); - res = CMD_ERROR; + return (CMD_ERROR); } - if (res == CMD_OK && staging_slop != new) { + if (staging_slop != new) { staging_slop = new; printf("changed slop, unloading kernel\n"); @@ -278,7 +275,7 @@ command_staging_slop(int argc, char *argv[]) } else { printf("staging slop %#lx\n", staging_slop); } - return (res); + return (CMD_OK); } COMMAND_SET(staging_slop, "staging_slop", "set staging slop", command_staging_slop);