Project

General

Profile

Bug #12416

hxge: variable may be used uninitialized

Added by Toomas Soome 2 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 9:

    ../../common/io/hxge/hxge_txdma.c: In function 'hxge_map_txdma_channel_buf_ring':
    ../../common/io/hxge/hxge_txdma.c:1866:12: error: 'size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1866 |  uint32_t  size, bsize;
          |            ^~~~
    ../../common/io/hxge/hxge_txdma.c:1865:14: error: 'index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1865 |  int   i, j, index;
          |              ^~~~~
    ../../common/io/hxge/hxge_txdma.c:1862:14: error: 'tx_msg_ring' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1862 |  p_tx_msg_t  tx_msg_ring;
          |              ^~~~~~~~~~~

    ../../common/io/hxge/hxge_send.c: In function 'hxge_start':
    ../../common/io/hxge/hxge_send.c:696:14: error: 'hdrp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      696 |  hdrp->value = tmp_len;
          |  ~~~~~~~~~~~~^~~~~~~~~
    ../../common/io/hxge/hxge_send.c:638:35: error: 'tx_msg_p' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      638 |   pkt_len = tx_msg_p->tx_msg_size = min_len;
          |             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

    ../../common/io/hxge/hxge_main.c: In function 'hxge_add_intrs_adv_type':
    ../../common/io/hxge/hxge_main.c:3932:21: error: 'inthandler' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3932 |   if ((ddi_status = ddi_intr_add_handler(intrp->htable[x],
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     3933 |       (ddi_intr_handler_t *)inthandler, arg1, arg2)) !=
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/io/hxge/hxge_main.c: In function 'hxge_add_intrs_adv_type_fix':
    ../../common/io/hxge/hxge_main.c:4074:21: error: 'inthandler' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4074 |   if ((ddi_status = ddi_intr_add_handler(intrp->htable[x],
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     4075 |       (ddi_intr_handler_t *)inthandler, arg1, arg2)) !=
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/io/hxge/hxge_rxdma.c: In function 'hxge_map_rxdma':
    ../../common/io/hxge/hxge_rxdma.c:2257:12: error: 'channel' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2257 |  uint16_t  channel;
          |            ^~~~~~~
    ../../common/io/hxge/hxge_rxdma.c: In function 'hxge_rxdma_hw_start':
    ../../common/io/hxge/hxge_rxdma.c:3246:12: error: 'rx_mbox_p' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3246 |   status = hxge_rxdma_start_channel(hxgep, channel,
          |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     3247 |       (p_rx_rbr_ring_t)rbr_rings[i],
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     3248 |       (p_rx_rcr_ring_t)rcr_rings[i],
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     3249 |       (p_rx_mbox_t)rx_mbox_p[i], rbr_rings[i]->rbb_max);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/io/hxge/hxge_virtual.c: In function 'hxge_ldgv_init':
    ../../common/io/hxge/hxge_virtual.c:561:6: error: 'ldgp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      561 |  ptr = ldgp;
          |  ~~~~^~~~~~
    cc1: all warnings being treated as errors

Also available in: Atom PDF