[radeon-alex:amd-staging-4.6 397/989] drivers/gpu/drm/amd/amdgpu/../dal/dc/calcs/bandwidth_calcs.c:2780:7: error: array subscript is above array bounds

kbuild test robot fengguang.wu at intel.com
Thu Jun 16 02:34:33 UTC 2016


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-4.6
head:   beebb009c05fd5a89617327a9cfb724f19cecf1b
commit: ccb00a9a5dc119aae7a8c71834f658cb3f203ad7 [397/989] drm/amd/dal: Simplify return value for HW programming
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        git checkout ccb00a9a5dc119aae7a8c71834f658cb3f203ad7
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.

All errors (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/../dal/dc/calcs/bandwidth_calcs.c: In function 'calculate_bandwidth':
>> drivers/gpu/drm/amd/amdgpu/../dal/dc/calcs/bandwidth_calcs.c:2780:7: error: array subscript is above array bounds [-Werror=array-bounds]
          bw_max(
          ^~~~~~~
           results->blackout_recovery_time,
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           bw_div(
           ~~~~~~~
            (sub(
            ~~~~~
             add(
             ~~~~
              mul(
              ~~~~
               bw_div(
               ~~~~~~~
                mul(
                ~~~~
                 results->display_bandwidth[k],
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 results->useful_bytes_per_request[k]),
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                results->bytes_per_request[k]),
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               vbios->blackout_duration),
               ~~~~~~~~~~~~~~~~~~~~~~~~~~
              bw_div(
              ~~~~~~~
               mul(
               ~~~~
                mul(
                ~~~~
                 mul(
                 ~~~~
                  (add(
                  ~~~~~
                   add(
                   ~~~~
                    mul(
                    ~~~~
                     vbios->mcifwrmc_urgent_latency,
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     int_to_fixed(
                     ~~~~~~~~~~~~~
                      2)),
                      ~~~~
                    results->dmif_burst_time[i][j]),
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   results->mcifwr_burst_time[y_clk_level][sclk_level])),
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  results->dispclk),
                  ~~~~~~~~~~~~~~~~~~
                 results->bytes_per_pixel[k]),
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                results->lines_interleaved_in_mem_access[k]),
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               results->latency_hiding_lines[k])),
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             results->adjusted_data_buffer_size[k])),
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            (sub(
            ~~~~~
             bw_div(
             ~~~~~~~
              mul(
              ~~~~
               mul(
               ~~~~
                results->dispclk,
                ~~~~~~~~~~~~~~~~~
                results->bytes_per_pixel[k]),
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               results->lines_interleaved_in_mem_access[k]),
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              results->latency_hiding_lines[k]),
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             bw_div(
             ~~~~~~~
              mul(
              ~~~~
               results->display_bandwidth[k],
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               results->useful_bytes_per_request[k]),
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              results->bytes_per_request[k])))));
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../dal/dc/calcs/bandwidth_calcs.c:2802:41: error: array subscript is above array bounds [-Werror=array-bounds]
                    results->dmif_burst_time[i][j]),
                    ~~~~~~~~~~~~~~~~~~~~~~~~^~~
   cc1: all warnings being treated as errors

vim +2780 drivers/gpu/drm/amd/amdgpu/../dal/dc/calcs/bandwidth_calcs.c

142fbbaab Harry Wentland 2015-11-25  2764  				if (ltn(results->adjusted_data_buffer_size[k],
142fbbaab Harry Wentland 2015-11-25  2765  					mul(
142fbbaab Harry Wentland 2015-11-25  2766  						bw_div(
142fbbaab Harry Wentland 2015-11-25  2767  							mul(
142fbbaab Harry Wentland 2015-11-25  2768  								results->display_bandwidth[k],
142fbbaab Harry Wentland 2015-11-25  2769  								results->useful_bytes_per_request[k]),
142fbbaab Harry Wentland 2015-11-25  2770  							results->bytes_per_request[k]),
142fbbaab Harry Wentland 2015-11-25  2771  						(add(
142fbbaab Harry Wentland 2015-11-25  2772  							add(
142fbbaab Harry Wentland 2015-11-25  2773  								vbios->blackout_duration,
142fbbaab Harry Wentland 2015-11-25  2774  								mul(
142fbbaab Harry Wentland 2015-11-25  2775  									vbios->mcifwrmc_urgent_latency,
142fbbaab Harry Wentland 2015-11-25  2776  									int_to_fixed(
142fbbaab Harry Wentland 2015-11-25  2777  										2))),
142fbbaab Harry Wentland 2015-11-25  2778  							results->mcifwr_burst_time[y_clk_level][sclk_level]))))) {
142fbbaab Harry Wentland 2015-11-25  2779  					results->blackout_recovery_time =
142fbbaab Harry Wentland 2015-11-25 @2780  						bw_max(
142fbbaab Harry Wentland 2015-11-25  2781  							results->blackout_recovery_time,
142fbbaab Harry Wentland 2015-11-25  2782  							bw_div(
142fbbaab Harry Wentland 2015-11-25  2783  								(sub(
142fbbaab Harry Wentland 2015-11-25  2784  									add(
142fbbaab Harry Wentland 2015-11-25  2785  										mul(
142fbbaab Harry Wentland 2015-11-25  2786  											bw_div(
142fbbaab Harry Wentland 2015-11-25  2787  												mul(
142fbbaab Harry Wentland 2015-11-25  2788  													results->display_bandwidth[k],

:::::: The code at line 2780 was first introduced by commit
:::::: 142fbbaab6655947879414a5a9730a6da12b7cf3 drm/amd/dal: Add dal display driver

:::::: TO: Harry Wentland <harry.wentland at amd.com>
:::::: CC: Alex Deucher <alexander.deucher at amd.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 54172 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160616/e2db6c0d/attachment-0001.obj>


More information about the dri-devel mailing list