From owner-dev-commits-src-all@freebsd.org Thu Jul 8 18:25:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A3C9651C1C; Thu, 8 Jul 2021 18:25:33 +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 4GLPqK1wPXz4ZcB; Thu, 8 Jul 2021 18:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 269F625D8B; Thu, 8 Jul 2021 18:25:33 +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 168IPX1r040625; Thu, 8 Jul 2021 18:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 168IPXki040624; Thu, 8 Jul 2021 18:25:33 GMT (envelope-from git) Date: Thu, 8 Jul 2021 18:25:33 GMT Message-Id: <202107081825.168IPXki040624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 34641052826c - main - pf: pf_killstates() never fails, so remove the return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34641052826c718566b994b75cd2bddb53a21583 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2021 18:25:33 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=34641052826c718566b994b75cd2bddb53a21583 commit 34641052826c718566b994b75cd2bddb53a21583 Author: Kristof Provost AuthorDate: 2021-07-08 08:54:16 +0000 Commit: Kristof Provost CommitDate: 2021-07-08 16:56:29 +0000 pf: pf_killstates() never fails, so remove the return value Suggested by: mjg MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index fece41e917e5..33eb0e15ea57 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -201,7 +201,7 @@ struct cdev *pf_dev; */ static void pf_clear_all_states(void); static unsigned int pf_clear_states(const struct pf_kstate_kill *); -static int pf_killstates(struct pf_kstate_kill *, +static void pf_killstates(struct pf_kstate_kill *, unsigned int *); static int pf_killstates_row(struct pf_kstate_kill *, struct pf_idhash *); @@ -2779,7 +2779,7 @@ DIOCCHANGERULE_error: break; psk->psk_killed = 0; - error = pf_killstates(&kill, &psk->psk_killed); + pf_killstates(&kill, &psk->psk_killed); break; } @@ -4834,7 +4834,7 @@ relock_DIOCCLRSTATES: return (killed); } -static int +static void pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) { struct pf_kstate *s; @@ -4847,13 +4847,13 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) pf_unlink_state(s, PF_ENTER_LOCKED); *killed = 1; } - return (0); + return; } for (unsigned int i = 0; i <= pf_hashmask; i++) *killed += pf_killstates_row(kill, &V_pf_idhash[i]); - return (0); + return; } static int @@ -4886,9 +4886,7 @@ pf_killstates_nv(struct pfioc_nv *nv) if (error) ERROUT(error); - error = pf_killstates(&kill, &killed); - if (error) - ERROUT(error); + pf_killstates(&kill, &killed); free(nvlpacked, M_NVLIST); nvlpacked = NULL;