Project

General

Profile

Actions

Bug #14515

open

mega_sas: build errors with clang

Added by Toomas Soome 6 months ago. Updated 6 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:

    ../../common/io/mega_sas/megaraid_sas.c:4018:18: error: array index 1 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
                    data_xferlen    = kstp->sgl.sge32[1].length;
                                      ^               ~
    ../../common/io/mega_sas/megaraid_sas.h:663:2: note: array 'sge32' declared here
            struct megasas_sge32    sge32[1];
            ^
    ../../common/io/mega_sas/megaraid_sas.c:4039:18: error: array index 1 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
                    data_xferlen    = kstp->sgl.sge64[1].length;
                                      ^               ~
    ../../common/io/mega_sas/megaraid_sas.h:664:2: note: array 'sge64' declared here
            struct megasas_sge64    sge64[1];
            ^
    ../../common/io/mega_sas/megaraid_sas.c:4121:2: error: array index 1 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
            stp->sgl.sge32[1].length = data_xferlen;
            ^              ~
    ../../common/io/mega_sas/megaraid_sas.h:663:2: note: array 'sge32' declared here
            struct megasas_sge32    sge32[1];
            ^
    ../../common/io/mega_sas/megaraid_sas.c:4122:2: error: array index 1 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
            stp->sgl.sge32[1].phys_addr = data_dma_obj.dma_cookie[0].dmac_address;
            ^              ~
    ../../common/io/mega_sas/megaraid_sas.h:663:2: note: array 'sge32' declared here
            struct megasas_sge32    sge32[1];
            ^
    4 errors generated.

    ../../common/io/mega_sas/megaraid_sas.c: In function 'megasas_attach':
    ../../common/io/mega_sas/megaraid_sas.c:298:11: error: variable 'irq' set but not used [-Werror=unused-but-set-variable]
      298 |  uint8_t  irq;
          |           ^~~
    ../../common/io/mega_sas/megaraid_sas.c: In function 'mfi_state_transition_to_ready':
    ../../common/io/mega_sas/megaraid_sas.c:2349:11: error: variable 'fw_ctrl' set but not used [-Werror=unused-but-set-variable]
     2349 |  uint32_t fw_ctrl;
          |           ^~~~~~~
    ../../common/io/mega_sas/megaraid_sas.c: In function 'service_mfi_aen':
    ../../common/io/mega_sas/megaraid_sas.c:2653:7: error: unused variable 'instance_no' [-Werror=unused-variable]
     2653 |   int instance_no = ddi_get_instance(instance->dip);
          |       ^~~~~~~~~~~
    ../../common/io/mega_sas/megaraid_sas.c: In function 'enable_intr_ppc':
    ../../common/io/mega_sas/megaraid_sas.c:4715:11: error: variable 'mask' set but not used [-Werror=unused-but-set-variable]
     4715 |  uint32_t mask;
          |           ^~~~
    At top level:
    ../../common/io/mega_sas/megaraid_sas.c:81:13: error: 'debug_level_g' defined but not used [-Werror=unused-variable]
       81 | static int  debug_level_g = CL_ANN;
          |             ^~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    make: Fatal error: Command failed for target `obj64/megaraid_sas.o'
    Current working directory /code/illumos-gate/usr/src/uts/intel/mega_sas

Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 2028
Actions

Also available in: Atom PDF