cxgb(4): Fix "set but not used [-Wunused-but-set-variable]" warnings.

MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2022-01-10 11:18:38 -08:00
parent 7356f661e8
commit 6792568fe2
5 changed files with 12 additions and 49 deletions

View File

@ -117,7 +117,7 @@ struct port_info {
#define PORT_NAME_LEN 32
char lockbuf[PORT_LOCK_NAME_LEN];
char namebuf[PORT_NAME_LEN];
} __aligned(L1_CACHE_BYTES);
} __aligned(CACHE_LINE_SIZE);
enum {
/* adapter flags */

View File

@ -94,28 +94,19 @@ struct t3_mbuf_hdr {
#define TX_WR_COUNT_MAX 7 /* the maximum total number of packets that can be
* aggregated into a single TX WR
*/
#if defined(__i386__) || defined(__amd64__)
static __inline
void prefetch(void *x)
{
__asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x));
}
#define prefetch(x) __builtin_prefetch(x)
#if defined(__i386__) || defined(__amd64__)
#define smp_mb() mb()
#define L1_CACHE_BYTES 128
#define WARN_ON(condition) do { \
if (__predict_false((condition)!=0)) { \
log(LOG_WARNING, "BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \
kdb_backtrace(); \
} \
} while (0)
#else
#else
#define smp_mb()
#define prefetch(x)
#define L1_CACHE_BYTES 32
#endif
#define DBG_RX (1 << 0)

View File

@ -2105,27 +2105,8 @@ t3_sge_start(adapter_t *sc)
void
t3_sge_stop(adapter_t *sc)
{
int i, nqsets;
t3_set_reg_field(sc, A_SG_CONTROL, F_GLOBALENABLE, 0);
if (sc->tq == NULL)
return;
for (nqsets = i = 0; i < (sc)->params.nports; i++)
nqsets += sc->port[i].nqsets;
#ifdef notyet
/*
*
* XXX
*/
for (i = 0; i < nqsets; ++i) {
struct sge_qset *qs = &sc->sge.qs[i];
taskqueue_drain(sc->tq, &qs->txq[TXQ_OFLD].qresume_task);
taskqueue_drain(sc->tq, &qs->txq[TXQ_CTRL].qresume_task);
}
#endif
t3_set_reg_field(sc, A_SG_CONTROL, F_GLOBALENABLE, 0);
}
/**
@ -2337,11 +2318,9 @@ restart_offloadq(void *data, int npending)
struct sge_qset *qs = data;
struct sge_txq *q = &qs->txq[TXQ_OFLD];
adapter_t *adap = qs->port->adapter;
int cleaned;
TXQ_LOCK(qs);
again: cleaned = reclaim_completed_tx(qs, 16, TXQ_OFLD);
TXQ_LOCK(qs);
again:
while ((m = mbufq_first(&q->sendq)) != NULL) {
unsigned int gen, pidx;
struct ofld_hdr *oh = mtod(m, struct ofld_hdr *);

View File

@ -19,7 +19,7 @@ __FBSDID("$FreeBSD$");
static int
cxgb_t3fw_modevent(module_t mod, int type, void *unused)
{
const struct firmware *fp, *parent;
const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
@ -29,7 +29,6 @@ cxgb_t3fw_modevent(module_t mod, int type, void *unused)
0, NULL);
if (fp == NULL)
goto fail_0;
parent = fp;
return (0);
fail_0:
return (ENXIO);
@ -52,7 +51,7 @@ MODULE_DEPEND(cxgb_t3fw, firmware, 1, 1, 1);
static int
cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused)
{
const struct firmware *fp, *parent;
const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
@ -62,7 +61,6 @@ cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused)
0, NULL);
if (fp == NULL)
goto fail_0;
parent = fp;
return (0);
fail_0:
return (ENXIO);
@ -85,7 +83,7 @@ MODULE_DEPEND(cxgb_t3b_protocol_sram, firmware, 1, 1, 1);
static int
cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused)
{
const struct firmware *fp, *parent;
const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
@ -95,7 +93,6 @@ cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused)
0, NULL);
if (fp == NULL)
goto fail_0;
parent = fp;
return (0);
fail_0:
return (ENXIO);
@ -118,7 +115,7 @@ MODULE_DEPEND(cxgb_t3b_tp_eeprom, firmware, 1, 1, 1);
static int
cxgb_t3c_protocol_sram_modevent(module_t mod, int type, void *unused)
{
const struct firmware *fp, *parent;
const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
@ -128,7 +125,6 @@ cxgb_t3c_protocol_sram_modevent(module_t mod, int type, void *unused)
0, NULL);
if (fp == NULL)
goto fail_0;
parent = fp;
return (0);
fail_0:
return (ENXIO);
@ -151,7 +147,7 @@ MODULE_DEPEND(cxgb_t3c_protocol_sram, firmware, 1, 1, 1);
static int
cxgb_t3c_tp_eeprom_modevent(module_t mod, int type, void *unused)
{
const struct firmware *fp, *parent;
const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
@ -161,7 +157,6 @@ cxgb_t3c_tp_eeprom_modevent(module_t mod, int type, void *unused)
0, NULL);
if (fp == NULL)
goto fail_0;
parent = fp;
return (0);
fail_0:
return (ENXIO);

View File

@ -57,13 +57,11 @@ busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map,
{
struct mbuf *n = *m;
int seg_count, defragged = 0, err = 0;
bus_dma_segment_t *psegs;
KASSERT(n->m_pkthdr.len, ("packet has zero header len"));
if (n->m_pkthdr.len <= PIO_LEN)
return (0);
retry:
psegs = segs;
seg_count = 0;
err = bus_dmamap_load_mbuf_sg(tag, map, *m, segs, &seg_count, 0);
if (seg_count == 0) {