summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@fingolfin.org>2020-12-28 18:32:52 -0800
committerRobert Mustacchi <rm@fingolfin.org>2021-02-15 09:31:29 -0800
commit89f249c9183aad7ca607490285fba9fc6cfa2cd0 (patch)
tree34ee095cdae44257cec23fd1fea13aa253ff821d
parent6be183eef7ea336db825abd64d8b464ca990a38b (diff)
downloadillumos-joyent-89f249c9183aad7ca607490285fba9fc6cfa2cd0.tar.gz
13407 reduce smatch gags in t4nex
Reviewed by: Gergő Mihály Doma <domag02@gmail.com> Reviewed by: Patrick Mooney <pmooney@pfmooney.com> Reviewed by: Andy Fiddaman <andy@omnios.org> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
-rw-r--r--usr/src/uts/common/io/cxgbe/common/t4_hw.c2
-rw-r--r--usr/src/uts/common/io/cxgbe/shared/shared.c6
-rw-r--r--usr/src/uts/common/io/cxgbe/t4nex/cudbg_lib.c2
-rw-r--r--usr/src/uts/common/io/cxgbe/t4nex/t4_sge.c8
-rw-r--r--usr/src/uts/intel/cxgbe/t4nex/Makefile2
5 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/uts/common/io/cxgbe/common/t4_hw.c b/usr/src/uts/common/io/cxgbe/common/t4_hw.c
index 82f7555945..9a877521fc 100644
--- a/usr/src/uts/common/io/cxgbe/common/t4_hw.c
+++ b/usr/src/uts/common/io/cxgbe/common/t4_hw.c
@@ -4345,7 +4345,7 @@ int t4_load_phy_fw(struct adapter *adap,
* If we have version number support, then check to see if the adapter
* already has up-to-date PHY firmware loaded.
*/
- if (phy_fw_version) {
+ if (phy_fw_version) {
new_phy_fw_vers = phy_fw_version(phy_fw_data, phy_fw_size);
ret = t4_phy_fw_ver(adap, &cur_phy_fw_ver);
if (ret < 0)
diff --git a/usr/src/uts/common/io/cxgbe/shared/shared.c b/usr/src/uts/common/io/cxgbe/shared/shared.c
index e86272134a..50b4bbe698 100644
--- a/usr/src/uts/common/io/cxgbe/shared/shared.c
+++ b/usr/src/uts/common/io/cxgbe/shared/shared.c
@@ -107,10 +107,10 @@ rxbuf_ctor(void *arg1, void *arg2, int kmflag)
int (*callback)(caddr_t);
int rc = ENOMEM;
- if (kmflag & KM_SLEEP)
- callback = DDI_DMA_SLEEP;
- else
+ if ((kmflag & KM_NOSLEEP) != 0)
callback = DDI_DMA_DONTWAIT;
+ else
+ callback = DDI_DMA_SLEEP;
rc = ddi_dma_alloc_handle(p->dip, &p->dma_attr_rx, callback, 0,
&rxb->dhdl);
diff --git a/usr/src/uts/common/io/cxgbe/t4nex/cudbg_lib.c b/usr/src/uts/common/io/cxgbe/t4nex/cudbg_lib.c
index cc194d8714..52eb1d8b84 100644
--- a/usr/src/uts/common/io/cxgbe/t4nex/cudbg_lib.c
+++ b/usr/src/uts/common/io/cxgbe/t4nex/cudbg_lib.c
@@ -2904,7 +2904,7 @@ check_busy_bit(struct adapter *padap)
int retry = 10;
int status = 0;
- while (busy & (1 < retry)) {
+ while (busy && (i < retry)) {
val = t4_read_reg(padap, A_CIM_HOST_ACC_CTRL);
busy = (0 != (val & CUDBG_CIM_BUSY_BIT));
i++;
diff --git a/usr/src/uts/common/io/cxgbe/t4nex/t4_sge.c b/usr/src/uts/common/io/cxgbe/t4nex/t4_sge.c
index b587656ba1..2f7856bd5e 100644
--- a/usr/src/uts/common/io/cxgbe/t4nex/t4_sge.c
+++ b/usr/src/uts/common/io/cxgbe/t4nex/t4_sge.c
@@ -1483,12 +1483,12 @@ static int
free_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl)
{
int rc;
- struct adapter *sc = iq->adapter;
- dev_info_t *dip;
-
- dip = pi ? pi->dip : sc->dip;
if (iq != NULL) {
+ struct adapter *sc = iq->adapter;
+ dev_info_t *dip;
+
+ dip = pi ? pi->dip : sc->dip;
if (iq->flags & IQ_ALLOCATED) {
rc = -t4_iq_free(sc, sc->mbox, sc->pf, 0,
FW_IQ_TYPE_FL_INT_CAP, iq->cntxt_id,
diff --git a/usr/src/uts/intel/cxgbe/t4nex/Makefile b/usr/src/uts/intel/cxgbe/t4nex/Makefile
index 337a39f8ac..cae1449725 100644
--- a/usr/src/uts/intel/cxgbe/t4nex/Makefile
+++ b/usr/src/uts/intel/cxgbe/t4nex/Makefile
@@ -54,7 +54,7 @@ CFLAGS += -I$(UTSBASE)/common/io/cxgbe -I$(UTSBASE)/common/io/cxgbe/common \
LDFLAGS += -dy -N misc/mac -N drv/ip
# needs work
-SMATCH=off
+SMOFF += all_func_returns,snprintf_overflow
#
# Default build targets.