git: 747fd2db538a - main - bnxt_en: Remove pointless NULL check for sysctl arg1
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 14 Feb 2025 10:41:00 UTC
The branch main has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=747fd2db538a85df84ae6ac1e58494295b4a65ee
commit 747fd2db538a85df84ae6ac1e58494295b4a65ee
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-02-14 10:38:30 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-02-14 10:38:30 +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
---
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 a8ae1d41d501..9c2d5bebbce7 100644
--- a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+++ b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
@@ -1792,9 +1792,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)
@@ -1944,9 +1941,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)
@@ -1972,9 +1966,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;
@@ -1999,9 +1990,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;
@@ -2029,9 +2017,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);
@@ -2087,9 +2072,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);