Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jun 2023 17:19:45 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 90f2fee0e040 - main - ipf: Remove set but unused variables.
Message-ID:  <202306271719.35RHJjeS006923@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=90f2fee0e0400a785db8e5eadad40801d77b74b8

commit 90f2fee0e0400a785db8e5eadad40801d77b74b8
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-06-27 17:19:32 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-06-27 17:19:32 +0000

    ipf: Remove set but unused variables.
    
    Reported by:    clang
    Differential Revision:  https://reviews.freebsd.org/D40667
---
 sbin/ipf/ipmon/ipmon.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sbin/ipf/ipmon/ipmon.c b/sbin/ipf/ipmon/ipmon.c
index 4f07dda27e62..3aa6d4d05043 100644
--- a/sbin/ipf/ipmon/ipmon.c
+++ b/sbin/ipf/ipmon/ipmon.c
@@ -304,7 +304,6 @@ static icmp_subtype_t *
 find_icmpsubtype(int type, icmp_subtype_t *table, size_t tablesz)
 {
 	icmp_subtype_t *ist;
-	int i;
 
 	if (tablesz < 2)
 		return (NULL);
@@ -312,11 +311,10 @@ find_icmpsubtype(int type, icmp_subtype_t *table, size_t tablesz)
 	if ((type < 0) || (type > table[tablesz - 2].ist_val))
 		return (NULL);
 
-	i = type;
 	if (table[type].ist_val == type)
 		return (table + type);
 
-	for (i = 0, ist = table; ist->ist_val != -2; i++, ist++)
+	for (ist = table; ist->ist_val != -2; ist++)
 		if (ist->ist_val == type)
 			return (ist);
 	return (NULL);
@@ -327,7 +325,6 @@ static icmp_type_t *
 find_icmptype(int type, icmp_type_t *table, size_t tablesz)
 {
 	icmp_type_t *it;
-	int i;
 
 	if (tablesz < 2)
 		return (NULL);
@@ -335,11 +332,10 @@ find_icmptype(int type, icmp_type_t *table, size_t tablesz)
 	if ((type < 0) || (type > table[tablesz - 2].it_val))
 		return (NULL);
 
-	i = type;
 	if (table[type].it_val == type)
 		return (table + type);
 
-	for (i = 0, it = table; it->it_val != -2; i++, it++)
+	for (it = table; it->it_val != -2; it++)
 		if (it->it_val == type)
 			return (it);
 	return (NULL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306271719.35RHJjeS006923>