Hi Hermes,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 2622649ad6cdbb3e77bfafc8c0fe686090b77f70]

url:    
https://github.com/intel-lab-lkp/linux/commits/Hermes-Wu-via-B4-Relay/dt-bindings-display-bridge-Add-ITE-IT6162-MIPI-DSI-to-HDMI-bridge/20260309-174457
base:   2622649ad6cdbb3e77bfafc8c0fe686090b77f70
patch link:    
https://lore.kernel.org/r/20260309-upstream-6162-v2-2-debdb6c88030%40ite.com.tw
patch subject: [PATCH v2 2/2] drm/bridge: Add ITE IT6162 MIPI DSI to HDMI 
bridge driver
config: hexagon-allmodconfig 
(https://download.01.org/0day-ci/archive/20260309/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 
6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20260309/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/bridge/ite-it6162.c:728:7: warning: variable 'cp_status' is 
>> used uninitialized whenever 'if' condition is false 
>> [-Wsometimes-uninitialized]
     728 |                 if (it6162->hdcp_sts != hdcp_sts ||
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     729 |                     it6162->hdcp_sts == NO_HDCP_STATE) {
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/ite-it6162.c:759:57: note: uninitialized use occurs 
here
     759 |                 
drm_hdcp_update_content_protection(it6162->connector, cp_status);
         |                                                                      
 ^~~~~~~~~
   drivers/gpu/drm/bridge/ite-it6162.c:728:3: note: remove the 'if' if its 
condition is always true
     728 |                 if (it6162->hdcp_sts != hdcp_sts ||
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     729 |                     it6162->hdcp_sts == NO_HDCP_STATE) {
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/ite-it6162.c:703:15: note: initialize the variable 
'cp_status' to silence this warning
     703 |         u64 cp_status;
         |                      ^
         |                       = 0
   1 warning generated.


vim +728 drivers/gpu/drm/bridge/ite-it6162.c

   695  
   696  static void it6162_hdcp_handler(struct it6162 *it6162)
   697  {
   698          struct regmap *regmap = it6162->regmap;
   699          unsigned int tx_status, sink_cap;
   700          enum hdcp_state hdcp_sts;
   701          struct it6162_hdcp_cfg *hdcp_cfg = &it6162->hdcp_cfg;
   702          u8 hdcp_ver;
   703          u64 cp_status;
   704  
   705          if (hdcp_cfg->hdcp_version == NO_HDCP || !it6162->en_hdcp) {
   706                  drm_dbg(it6162->drm, "HDCP not enabled, skip hdcp 
check");
   707                  return;
   708          }
   709  
   710          regmap_read(regmap, OFFSET_TX_STATUS, &tx_status);
   711          regmap_read(regmap, OFFSET_SINK_CAP, &sink_cap);
   712  
   713          drm_dbg(it6162->drm, "Tx status %x", tx_status);
   714          drm_dbg(it6162->drm, "SINK capability %x", sink_cap);
   715  
   716          if (!GET_TX_VIDEO_STATUS(tx_status)) {
   717                  drm_dbg(it6162->drm, "video not stable, skip hdcp 
check");
   718                  return;
   719          }
   720  
   721          hdcp_sts = GET_TX_HDCP_STATUS(tx_status);
   722          hdcp_ver = GET_SINK_CAP_HDCP_VER(sink_cap);
   723          drm_dbg(it6162->drm, "hdcp status: %x->%x, version: %x-%x",
   724                  it6162->hdcp_sts, hdcp_sts,
   725                  it6162->hdcp_version, hdcp_ver);
   726  
   727          if (it6162->hdcp_version != NO_HDCP) {
 > 728                  if (it6162->hdcp_sts != hdcp_sts ||
   729                      it6162->hdcp_sts == NO_HDCP_STATE) {
   730                          it6162->hdcp_sts = hdcp_sts;
   731                          cp_status = DRM_MODE_CONTENT_PROTECTION_DESIRED;
   732                          switch (hdcp_sts) {
   733                          case AUTH_DONE:
   734                                  drm_dbg(it6162->drm, "HDCP AUTH DONE");
   735                                  it6162_update_hdcp(it6162);
   736                                  cp_status = 
DRM_MODE_CONTENT_PROTECTION_ENABLED;
   737                                  break;
   738                          case AUTH_FAIL:
   739                                  drm_dbg(it6162->drm, "HDCP AUTH FAIL");
   740                                  if (hdcp_ver == HDCP_23) {
   741                                          drm_dbg(it6162->drm,
   742                                                  "HDCP 2.3 auth fail, 
change to HDCP 1.4");
   743                                          it6162_tx_hdcp_setup(it6162,
   744                                                               HDCP_14,
   745                                                               true);
   746                                  } else {
   747                                          it6162_tx_hdcp_disable(it6162);
   748                                  }
   749  
   750                                  break;
   751                          default:
   752                                  drm_dbg(it6162->drm, "HDCP NO AUTH");
   753                                  it6162_tx_hdcp_setup(it6162,
   754                                                       
it6162->hdcp_version,
   755                                                       true);
   756                                  break;
   757                          }
   758                  }
   759                  drm_hdcp_update_content_protection(it6162->connector, 
cp_status);
   760          }
   761  }
   762  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Reply via email to