From nobody Tue Feb 7 07:44:09 2023 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 4P9wB15wJkz3pJw2; Tue, 7 Feb 2023 07:44:09 +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 4P9wB145mgz48KV; Tue, 7 Feb 2023 07:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675755849; 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=AVP7UVVX3vWWSyPDdLxi4s+5iYPUdrxKVNt5CyRMlIE=; b=DXrUwThj0YFCWBRVkbN3Vei6OaLlSoapSP6XU1M/L3JB48AlIv6MOtBSW/ST0R6GpROcgr HfI3UzNc+rN36WJU2hcbWRD79+Mc2hjZasW7+K99up6rbO8wY4eZOFINZGoE9h9znZkkvI 3uTwsl9qysy4mVAhxHrpS+NeSZ2pZ+x/Wl16j/l9ZRo8MN8478LUgPfilFgRRA9tf04hc9 e0uWyIyF2pVxIRLlGi+hLn5lgbxYU7dQHA8GUylJqyaW4Ut3NBwk2vNpVaoh4Uj2N0uAQC 371qJreHovbbtAsDxXqBNFWIsD0FqLrNW47pWw4wWWZW+mjlJa3EzI5a63seug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675755849; 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=AVP7UVVX3vWWSyPDdLxi4s+5iYPUdrxKVNt5CyRMlIE=; b=q7VJw8A/GgN8MCxH1Zi86KZnu7Z9rgzvW9yqh67GPJR3rpu3njQdnFoFYU8BHWi/VXPP/Z 4cDrk9aDENqwkcQHk4ZO7Bk6ClwR+KE3GwGFYqWqg7IvyzPFWnL+Sbcs113jsSHG0cOj+N QW7FTaEAFNAylFIjwD5gWMpQypb4w5wYM6kXqIpVfHNeKSA2P376MrfuZNfifGAhIqjmdY 95n0QAdJ+d7jjyHoTE2k1gCX0vjsH5Lgcd+E5kbEWBTkW4tFAHbj66DrV2/x69MNzLjSE7 JpTt6YdLtmNcc1Vnd1XQQdFLMcifYo2z1FTagx9688PzaJvGzHqM86QBowgqCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675755849; a=rsa-sha256; cv=none; b=dHFPdp9K2WDz5+2OJW/sNQBdvhhC7FCU4avoeCrtBLjN+Q+1smoEWafmZaIx+w67JIlLDv 4oJEuoQ1mrS/mCInwi9u+nRaJvNkx5ryqXdVjFuQIOvkMHl86tA+9Stl3a0T+t6+xZNYrf Hqpw9cYKFBw5fAgvgHefKa81YNmgs9CxtzfsO2z4ncRrvyGRIbB0WM6yUxIxEJqa62QaZc QdXeQsHOPTi4VNEfv2QXWAruC4zDG3/E1q7D2wjVoOL/cXDKPZQjpKNgtBc6Hpnl4S3gCa WdtQyAhz3djFrKvuceXCeVaRHE4P6ZlwXmy3RNHeuaUqGIlPH+ED8L27g2QVtA== 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 4P9wB13Bhqz17p3; Tue, 7 Feb 2023 07:44:09 +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 3177i9N3062867; Tue, 7 Feb 2023 07:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3177i9MJ062866; Tue, 7 Feb 2023 07:44:09 GMT (envelope-from git) Date: Tue, 7 Feb 2023 07:44:09 GMT Message-Id: <202302070744.3177i9MJ062866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 901b050b36b9 - main - bsdlabel: Remove a write-only 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: 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 901b050b36b991a9399acfb9c3eeb33704c5af03 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=901b050b36b991a9399acfb9c3eeb33704c5af03 commit 901b050b36b991a9399acfb9c3eeb33704c5af03 Author: Dmitry Chagin AuthorDate: 2023-02-07 07:43:18 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-07 07:43:18 +0000 bsdlabel: Remove a write-only variable. Since r149061 (2005) the total_size variable is write-only. Differential Revision: https://reviews.freebsd.org/D38368 MFC after: 2 weeks --- sbin/bsdlabel/bsdlabel.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 943f37207fc2..efe7eebf23c6 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -1094,7 +1094,7 @@ checklabel(struct disklabel *lp) struct partition *pp; int i, errors = 0; char part; - u_long base_offset, needed, total_size, total_percent, current_offset; + u_long base_offset, needed, total_percent, current_offset; long free_space; int seen_default_offset; int hog_part; @@ -1173,7 +1173,6 @@ checklabel(struct disklabel *lp) /* first allocate space to the partitions, then offsets */ - total_size = 0; /* in sectors */ total_percent = 0; /* in percent */ hog_part = -1; /* find all fixed partitions */ @@ -1234,9 +1233,6 @@ checklabel(struct disklabel *lp) size /= lp->d_secsize; pp->p_size = size; } - /* else already in sectors */ - if (i != RAW_PART) - total_size += size; } } } @@ -1272,7 +1268,6 @@ checklabel(struct disklabel *lp) if (part_set[i] && part_size_type[i] == '%') { /* careful of overflows! and integer roundoff */ pp->p_size = ((double)pp->p_size/100) * free_space; - total_size += pp->p_size; /* FIX we can lose a sector or so due to roundoff per partition. A more complex algorithm could avoid that */ @@ -1328,7 +1323,6 @@ checklabel(struct disklabel *lp) } else { lp->d_partitions[hog_part].p_size = current_offset - base_offset - needed; - total_size += lp->d_partitions[hog_part].p_size; } }