提交 b18ee6a2 编写于 作者: P Philippe Mathieu-Daudé 提交者: Laurent Vivier

hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP)

Fix warnings reported by Clang static code analyzer:

    CC      hw/net/rocker/rocker.o
  hw/net/rocker/rocker.c:213:9: warning: Value stored to 'tx_tso_mss' is never read
          tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
          ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  hw/net/rocker/rocker.c:217:9: warning: Value stored to 'tx_tso_hdr_len' is never read
          tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
          ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  hw/net/rocker/rocker.c:255:9: warning: Value stored to 'tx_l3_csum_off' is never read
          tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
          ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: dc488f88
Reported-by: Clang Static Analyzer
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20200217101637.27558-1-philmd@redhat.com>
Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
上级 400be27f
......@@ -27,6 +27,7 @@
#include "qemu/iov.h"
#include "qemu/module.h"
#include "qemu/bitops.h"
#include "qemu/log.h"
#include "rocker.h"
#include "rocker_hw.h"
......@@ -207,14 +208,22 @@ static int tx_consume(Rocker *r, DescInfo *info)
if (tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]) {
tx_l3_csum_off = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]);
qemu_log_mask(LOG_UNIMP, "rocker %s: L3 not implemented"
" (cksum off: %u)\n",
__func__, tx_l3_csum_off);
}
if (tlvs[ROCKER_TLV_TX_TSO_MSS]) {
tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented (MSS: %u)\n",
__func__, tx_tso_mss);
}
if (tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]) {
tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented"
" (hdr length: %u)\n",
__func__, tx_tso_hdr_len);
}
rocker_tlv_for_each_nested(tlv_frag, tlvs[ROCKER_TLV_TX_FRAGS], rem) {
......@@ -249,12 +258,6 @@ static int tx_consume(Rocker *r, DescInfo *info)
iovcnt++;
}
if (iovcnt) {
/* XXX perform Tx offloads */
/* XXX silence compiler for now */
tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
}
err = fp_port_eg(r->fp_port[port], iov, iovcnt);
err_too_many_frags:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册