Hi Larry,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c0a3a64e723324ae6dda53214061a71de63808c3
commit: 5b5ab4cb5cda824ef59e0511ac5d585f35f1a1a6 staging: r8822be: Add 
Makefiles and Kconfig for new driver
date:   5 weeks ago
config: x86_64-randconfig-n0-09231026 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
        git checkout 5b5ab4cb5cda824ef59e0511ac5d585f35f1a1a6
        # 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 warnings (new ones prefixed by >>):

   Cyclomatic Complexity 5 
drivers/staging//rtlwifi/phydm/phydm_dig.c:get_igi_for_diff
   Cyclomatic Complexity 11 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_fa_threshold_check
   Cyclomatic Complexity 7 
drivers/staging//rtlwifi/phydm/phydm_dig.c:phydm_get_current_igi
   Cyclomatic Complexity 21 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_dig_abort
   Cyclomatic Complexity 16 
drivers/staging//rtlwifi/phydm/phydm_dig.c:phydm_set_big_jump_step
   Cyclomatic Complexity 19 
drivers/staging//rtlwifi/phydm/phydm_dig.c:phydm_check_ap_write_dig
   Cyclomatic Complexity 60 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_forbidden_igi_check
   Cyclomatic Complexity 21 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_change_dynamic_init_gain_thresh
   Cyclomatic Complexity 59 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_write_dig
   Cyclomatic Complexity 56 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_pause_dig
   Cyclomatic Complexity 13 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_dig_init
   Cyclomatic Complexity 197 drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_DIG
   Cyclomatic Complexity 22 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_dig_by_rssi_lps
   Cyclomatic Complexity 35 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_false_alarm_counter_statistics
   Cyclomatic Complexity 3 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_write_cck_cca_thres
   Cyclomatic Complexity 56 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_pause_cck_packet_detection
   Cyclomatic Complexity 31 
drivers/staging//rtlwifi/phydm/phydm_dig.c:odm_cck_packet_detection_thresh
   Cyclomatic Complexity 1 
drivers/staging//rtlwifi/phydm/phydm_dig.c:phydm_dig_go_up_check
   drivers/staging//rtlwifi/phydm/phydm_dig.c: In function 'odm_pause_dig':
>> drivers/staging//rtlwifi/phydm/phydm_dig.c:494:45: warning: array subscript 
>> is below array bounds [-Warray-bounds]
      odm_write_dig(dm, dig_tab->pause_dig_value[max_level]);
                                                ^
   drivers/staging//rtlwifi/phydm/phydm_dig.c: In function 
'odm_pause_cck_packet_detection':
   drivers/staging//rtlwifi/phydm/phydm_dig.c:1429:32: warning: array subscript 
is below array bounds [-Warray-bounds]
         dig_tab->pause_cckpd_value[max_level]);
                                   ^

vim +494 drivers/staging//rtlwifi/phydm/phydm_dig.c

9ce99b04 Ping-Ke Shih 2017-08-17  380  
9ce99b04 Ping-Ke Shih 2017-08-17  381  void odm_pause_dig(void *dm_void, enum 
phydm_pause_type pause_type,
9ce99b04 Ping-Ke Shih 2017-08-17  382              enum phydm_pause_level 
pause_level, u8 igi_value)
9ce99b04 Ping-Ke Shih 2017-08-17  383  {
9ce99b04 Ping-Ke Shih 2017-08-17  384   struct phy_dm_struct *dm = (struct 
phy_dm_struct *)dm_void;
9ce99b04 Ping-Ke Shih 2017-08-17  385   struct dig_thres *dig_tab = 
&dm->dm_dig_table;
9ce99b04 Ping-Ke Shih 2017-08-17  386   s8 max_level;
9ce99b04 Ping-Ke Shih 2017-08-17  387  
9ce99b04 Ping-Ke Shih 2017-08-17  388   ODM_RT_TRACE(dm, ODM_COMP_DIG, 
"%s()=========> level = %d\n", __func__,
9ce99b04 Ping-Ke Shih 2017-08-17  389                pause_level);
9ce99b04 Ping-Ke Shih 2017-08-17  390  
9ce99b04 Ping-Ke Shih 2017-08-17  391   if ((dig_tab->pause_dig_level == 0) &&
9ce99b04 Ping-Ke Shih 2017-08-17  392       (!(dm->support_ability & 
ODM_BB_DIG) ||
9ce99b04 Ping-Ke Shih 2017-08-17  393        !(dm->support_ability & 
ODM_BB_FA_CNT))) {
9ce99b04 Ping-Ke Shih 2017-08-17  394           ODM_RT_TRACE(
9ce99b04 Ping-Ke Shih 2017-08-17  395                   dm, ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  396                   "%s(): Return: 
support_ability DIG or FA is disabled !!\n",
9ce99b04 Ping-Ke Shih 2017-08-17  397                   __func__);
9ce99b04 Ping-Ke Shih 2017-08-17  398           return;
9ce99b04 Ping-Ke Shih 2017-08-17  399   }
9ce99b04 Ping-Ke Shih 2017-08-17  400  
9ce99b04 Ping-Ke Shih 2017-08-17  401   if (pause_level > 
DM_DIG_MAX_PAUSE_TYPE) {
9ce99b04 Ping-Ke Shih 2017-08-17  402           ODM_RT_TRACE(dm, ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  403                        "%s(): Return: 
Wrong pause level !!\n", __func__);
9ce99b04 Ping-Ke Shih 2017-08-17  404           return;
9ce99b04 Ping-Ke Shih 2017-08-17  405   }
9ce99b04 Ping-Ke Shih 2017-08-17  406  
9ce99b04 Ping-Ke Shih 2017-08-17  407   ODM_RT_TRACE(dm, ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  408                "%s(): pause level = 0x%x, 
Current value = 0x%x\n",
9ce99b04 Ping-Ke Shih 2017-08-17  409                __func__, 
dig_tab->pause_dig_level, igi_value);
9ce99b04 Ping-Ke Shih 2017-08-17  410   ODM_RT_TRACE(
9ce99b04 Ping-Ke Shih 2017-08-17  411           dm, ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  412           "%s(): pause value = 0x%x 0x%x 
0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
9ce99b04 Ping-Ke Shih 2017-08-17  413           __func__, 
dig_tab->pause_dig_value[7],
9ce99b04 Ping-Ke Shih 2017-08-17  414           dig_tab->pause_dig_value[6], 
dig_tab->pause_dig_value[5],
9ce99b04 Ping-Ke Shih 2017-08-17  415           dig_tab->pause_dig_value[4], 
dig_tab->pause_dig_value[3],
9ce99b04 Ping-Ke Shih 2017-08-17  416           dig_tab->pause_dig_value[2], 
dig_tab->pause_dig_value[1],
9ce99b04 Ping-Ke Shih 2017-08-17  417           dig_tab->pause_dig_value[0]);
9ce99b04 Ping-Ke Shih 2017-08-17  418  
9ce99b04 Ping-Ke Shih 2017-08-17  419   switch (pause_type) {
9ce99b04 Ping-Ke Shih 2017-08-17  420   /* Pause DIG */
9ce99b04 Ping-Ke Shih 2017-08-17  421   case PHYDM_PAUSE: {
9ce99b04 Ping-Ke Shih 2017-08-17  422           /* Disable DIG */
9ce99b04 Ping-Ke Shih 2017-08-17  423           odm_cmn_info_update(dm, 
ODM_CMNINFO_ABILITY,
9ce99b04 Ping-Ke Shih 2017-08-17  424                               
dm->support_ability & (~ODM_BB_DIG));
9ce99b04 Ping-Ke Shih 2017-08-17  425           ODM_RT_TRACE(dm, ODM_COMP_DIG, 
"%s(): Pause DIG !!\n",
9ce99b04 Ping-Ke Shih 2017-08-17  426                        __func__);
9ce99b04 Ping-Ke Shih 2017-08-17  427  
9ce99b04 Ping-Ke Shih 2017-08-17  428           /* Backup IGI value */
9ce99b04 Ping-Ke Shih 2017-08-17  429           if (dig_tab->pause_dig_level == 
0) {
9ce99b04 Ping-Ke Shih 2017-08-17  430                   dig_tab->igi_backup = 
dig_tab->cur_ig_value;
9ce99b04 Ping-Ke Shih 2017-08-17  431                   ODM_RT_TRACE(
9ce99b04 Ping-Ke Shih 2017-08-17  432                           dm, 
ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  433                           "%s(): Backup 
IGI  = 0x%x, new IGI = 0x%x\n",
9ce99b04 Ping-Ke Shih 2017-08-17  434                           __func__, 
dig_tab->igi_backup, igi_value);
9ce99b04 Ping-Ke Shih 2017-08-17  435           }
9ce99b04 Ping-Ke Shih 2017-08-17  436  
9ce99b04 Ping-Ke Shih 2017-08-17  437           /* Record IGI value */
9ce99b04 Ping-Ke Shih 2017-08-17  438           
dig_tab->pause_dig_value[pause_level] = igi_value;
9ce99b04 Ping-Ke Shih 2017-08-17  439  
9ce99b04 Ping-Ke Shih 2017-08-17  440           /* Update pause level */
9ce99b04 Ping-Ke Shih 2017-08-17  441           dig_tab->pause_dig_level =
9ce99b04 Ping-Ke Shih 2017-08-17  442                   
(dig_tab->pause_dig_level | BIT(pause_level));
9ce99b04 Ping-Ke Shih 2017-08-17  443  
9ce99b04 Ping-Ke Shih 2017-08-17  444           /* Write new IGI value */
9ce99b04 Ping-Ke Shih 2017-08-17  445           if (BIT(pause_level + 1) > 
dig_tab->pause_dig_level) {
9ce99b04 Ping-Ke Shih 2017-08-17  446                   odm_write_dig(dm, 
igi_value);
9ce99b04 Ping-Ke Shih 2017-08-17  447                   ODM_RT_TRACE(dm, 
ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  448                                "%s(): IGI 
of higher level = 0x%x\n",
9ce99b04 Ping-Ke Shih 2017-08-17  449                                __func__, 
igi_value);
9ce99b04 Ping-Ke Shih 2017-08-17  450           }
9ce99b04 Ping-Ke Shih 2017-08-17  451           break;
9ce99b04 Ping-Ke Shih 2017-08-17  452   }
9ce99b04 Ping-Ke Shih 2017-08-17  453   /* Resume DIG */
9ce99b04 Ping-Ke Shih 2017-08-17  454   case PHYDM_RESUME: {
9ce99b04 Ping-Ke Shih 2017-08-17  455           /* check if the level is 
illegal or not */
9ce99b04 Ping-Ke Shih 2017-08-17  456           if ((dig_tab->pause_dig_level & 
(BIT(pause_level))) != 0) {
9ce99b04 Ping-Ke Shih 2017-08-17  457                   
dig_tab->pause_dig_level = dig_tab->pause_dig_level &
9ce99b04 Ping-Ke Shih 2017-08-17  458                                           
   (~(BIT(pause_level)));
9ce99b04 Ping-Ke Shih 2017-08-17  459                   
dig_tab->pause_dig_value[pause_level] = 0;
9ce99b04 Ping-Ke Shih 2017-08-17  460                   ODM_RT_TRACE(dm, 
ODM_COMP_DIG, "%s(): Resume DIG !!\n",
9ce99b04 Ping-Ke Shih 2017-08-17  461                                __func__);
9ce99b04 Ping-Ke Shih 2017-08-17  462           } else {
9ce99b04 Ping-Ke Shih 2017-08-17  463                   ODM_RT_TRACE(dm, 
ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  464                                "%s(): 
Wrong resume level !!\n", __func__);
9ce99b04 Ping-Ke Shih 2017-08-17  465                   break;
9ce99b04 Ping-Ke Shih 2017-08-17  466           }
9ce99b04 Ping-Ke Shih 2017-08-17  467  
9ce99b04 Ping-Ke Shih 2017-08-17  468           /* Resume DIG */
9ce99b04 Ping-Ke Shih 2017-08-17  469           if (dig_tab->pause_dig_level == 
0) {
9ce99b04 Ping-Ke Shih 2017-08-17  470                   /* Write backup IGI 
value */
9ce99b04 Ping-Ke Shih 2017-08-17  471                   odm_write_dig(dm, 
dig_tab->igi_backup);
9ce99b04 Ping-Ke Shih 2017-08-17  472                   dig_tab->is_ignore_dig 
= true;
9ce99b04 Ping-Ke Shih 2017-08-17  473                   ODM_RT_TRACE(dm, 
ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  474                                "%s(): 
Write original IGI = 0x%x\n",
9ce99b04 Ping-Ke Shih 2017-08-17  475                                __func__, 
dig_tab->igi_backup);
9ce99b04 Ping-Ke Shih 2017-08-17  476  
9ce99b04 Ping-Ke Shih 2017-08-17  477                   /* Enable DIG */
9ce99b04 Ping-Ke Shih 2017-08-17  478                   odm_cmn_info_update(dm, 
ODM_CMNINFO_ABILITY,
9ce99b04 Ping-Ke Shih 2017-08-17  479                                       
dm->support_ability | ODM_BB_DIG);
9ce99b04 Ping-Ke Shih 2017-08-17  480                   break;
9ce99b04 Ping-Ke Shih 2017-08-17  481           }
9ce99b04 Ping-Ke Shih 2017-08-17  482  
9ce99b04 Ping-Ke Shih 2017-08-17  483           if (BIT(pause_level) <= 
dig_tab->pause_dig_level)
9ce99b04 Ping-Ke Shih 2017-08-17  484                   break;
9ce99b04 Ping-Ke Shih 2017-08-17  485  
9ce99b04 Ping-Ke Shih 2017-08-17  486           /* Calculate the maximum level 
now */
9ce99b04 Ping-Ke Shih 2017-08-17  487           for (max_level = (pause_level - 
1); max_level >= 0;
9ce99b04 Ping-Ke Shih 2017-08-17  488                max_level--) {
9ce99b04 Ping-Ke Shih 2017-08-17  489                   if 
((dig_tab->pause_dig_level & BIT(max_level)) > 0)
9ce99b04 Ping-Ke Shih 2017-08-17  490                           break;
9ce99b04 Ping-Ke Shih 2017-08-17  491           }
9ce99b04 Ping-Ke Shih 2017-08-17  492  
9ce99b04 Ping-Ke Shih 2017-08-17  493           /* write IGI of lower level */
9ce99b04 Ping-Ke Shih 2017-08-17 @494           odm_write_dig(dm, 
dig_tab->pause_dig_value[max_level]);
9ce99b04 Ping-Ke Shih 2017-08-17  495           ODM_RT_TRACE(dm, ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  496                        "%s(): Write IGI 
(0x%x) of level (%d)\n", __func__,
9ce99b04 Ping-Ke Shih 2017-08-17  497                        
dig_tab->pause_dig_value[max_level], max_level);
9ce99b04 Ping-Ke Shih 2017-08-17  498           break;
9ce99b04 Ping-Ke Shih 2017-08-17  499   }
9ce99b04 Ping-Ke Shih 2017-08-17  500   default:
9ce99b04 Ping-Ke Shih 2017-08-17  501           ODM_RT_TRACE(dm, ODM_COMP_DIG, 
"%s(): Wrong  type !!\n",
9ce99b04 Ping-Ke Shih 2017-08-17  502                        __func__);
9ce99b04 Ping-Ke Shih 2017-08-17  503           break;
9ce99b04 Ping-Ke Shih 2017-08-17  504   }
9ce99b04 Ping-Ke Shih 2017-08-17  505  
9ce99b04 Ping-Ke Shih 2017-08-17  506   ODM_RT_TRACE(dm, ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  507                "%s(): pause level = 0x%x, 
Current value = 0x%x\n",
9ce99b04 Ping-Ke Shih 2017-08-17  508                __func__, 
dig_tab->pause_dig_level, igi_value);
9ce99b04 Ping-Ke Shih 2017-08-17  509   ODM_RT_TRACE(
9ce99b04 Ping-Ke Shih 2017-08-17  510           dm, ODM_COMP_DIG,
9ce99b04 Ping-Ke Shih 2017-08-17  511           "%s(): pause value = 0x%x 0x%x 
0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
9ce99b04 Ping-Ke Shih 2017-08-17  512           __func__, 
dig_tab->pause_dig_value[7],
9ce99b04 Ping-Ke Shih 2017-08-17  513           dig_tab->pause_dig_value[6], 
dig_tab->pause_dig_value[5],
9ce99b04 Ping-Ke Shih 2017-08-17  514           dig_tab->pause_dig_value[4], 
dig_tab->pause_dig_value[3],
9ce99b04 Ping-Ke Shih 2017-08-17  515           dig_tab->pause_dig_value[2], 
dig_tab->pause_dig_value[1],
9ce99b04 Ping-Ke Shih 2017-08-17  516           dig_tab->pause_dig_value[0]);
9ce99b04 Ping-Ke Shih 2017-08-17  517  }
9ce99b04 Ping-Ke Shih 2017-08-17  518  

:::::: The code at line 494 was first introduced by commit
:::::: 9ce99b04b5b82fdf11e4c76b60a5f82c1e541297 staging: r8822be: Add phydm 
mini driver

:::::: TO: Ping-Ke Shih <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to