git: 072303d432eb - stable/14 - bnxt_en: Remove pointless NULL check for sysctl arg1
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 22 Feb 2025 02:51:39 UTC
The branch stable/14 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=072303d432ebe02637c2fbfaf9d6a2805c5514ed
commit 072303d432ebe02637c2fbfaf9d6a2805c5514ed
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-02-14 10:38:30 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-02-22 02:50:55 +0000
bnxt_en: Remove pointless NULL check for sysctl arg1
Those sysctl handlers have been guaranteed to have non-null softc. No
need for NULL check within sysctl handlers.
No functional change intended.
Reviewed by: markj
Tested by: Daniel Porsch <daniel.porsch@loopia.se>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48495
(cherry picked from commit 747fd2db538a85df84ae6ac1e58494295b4a65ee)
---
sys/dev/bnxt/bnxt_en/bnxt_sysctl.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
index 9114f5d1deaa..671ceef570f4 100644
--- a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+++ b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
@@ -1793,9 +1793,6 @@ bnxt_dcb_dcbx_cap(SYSCTL_HANDLER_ARGS)
int val;
int rc;
- if (softc == NULL)
- return EBUSY;
-
val = bnxt_dcb_getdcbx(softc);
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
@@ -1945,9 +1942,6 @@ bnxt_dcb_list_app(SYSCTL_HANDLER_ARGS)
int rc, num_inputs = 0;
char *buf;
- if (softc == NULL)
- return EBUSY;
-
#define BNXT_APP_TLV_STR_LEN 4096
buf = malloc(BNXT_APP_TLV_STR_LEN, M_DEVBUF, M_NOWAIT | M_ZERO);
if (!buf)
@@ -1973,9 +1967,6 @@ bnxt_dcb_del_app(SYSCTL_HANDLER_ARGS)
char buf[256] = {0};
int rc, num_inputs;
- if (softc == NULL)
- return EBUSY;
-
rc = sysctl_handle_string(oidp, buf, sizeof(buf), req);
if (rc || req->newptr == NULL)
return rc;
@@ -2000,9 +1991,6 @@ bnxt_dcb_set_app(SYSCTL_HANDLER_ARGS)
char buf[256] = {0};
int rc, num_inputs;
- if (softc == NULL)
- return EBUSY;
-
rc = sysctl_handle_string(oidp, buf, sizeof(buf), req);
if (rc || req->newptr == NULL)
return rc;
@@ -2030,9 +2018,6 @@ bnxt_dcb_pfc(SYSCTL_HANDLER_ARGS)
int pri_mask = 0;
char pri[8];
- if (softc == NULL)
- return EBUSY;
-
rc = bnxt_dcb_ieee_getpfc(softc, &pfc);
if (!rc)
bnxt_pfc_get_string(softc, buf, &pfc);
@@ -2088,9 +2073,6 @@ bnxt_dcb_ets(SYSCTL_HANDLER_ARGS)
char buf[256] = {0};
char tsa[8];
- if (softc == NULL)
- return EBUSY;
-
rc = bnxt_dcb_ieee_getets(softc, &ets);
if (!rc)
bnxt_ets_get_string(softc, buf);