Content-Type: multipart/mixed; boundary="===============1942235973497529933==" MIME-Version: 1.0 From: Hans de Goede To: kbuild-all@lists.01.org Subject: Re: [Intel-gfx] [PATCH v2 5/9] drm/connector: Add a drm_connector privacy-screen helper functions Date: Thu, 22 Apr 2021 09:38:22 +0200 Message-ID: In-Reply-To: <202104220943.O0mqK4tN-lkp@intel.com> List-Id: --===============1942235973497529933== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi All, On 4/22/21 3:11 AM, kernel test robot wrote: > Hi Hans, > = > I love your patch! Perhaps something to improve: > = > [auto build test WARNING on drm-intel/for-linux-next] > [also build test WARNING on drm-tip/drm-tip linus/master v5.12-rc8 next-2= 0210421] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch] > = > url: https://github.com/0day-ci/linux/commits/Hans-de-Goede/drm-Add-pr= ivacy-screen-class-and-connector-properties/20210422-045141 > base: git://anongit.freedesktop.org/drm-intel for-linux-next > config: sparc64-randconfig-p002-20210421 (attached as .config) > compiler: sparc64-linux-gcc (GCC) 9.3.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/0day-ci/linux/commit/62771e46e3031f0e2cea952= 9f292b6415810cf9c > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Hans-de-Goede/drm-Add-privacy-sc= reen-class-and-connector-properties/20210422-045141 > git checkout 62771e46e3031f0e2cea9529f292b6415810cf9c > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-9.3.0 make.cros= s W=3D1 ARCH=3Dsparc64 = > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > All warnings (new ones prefixed by >>): > = > drivers/gpu/drm/drm_connector.c: In function 'drm_connector_privacy_sc= reen_notifier': >>> drivers/gpu/drm/drm_connector.c:2380:44: warning: 'sw_state' is used un= initialized in this function [-Wuninitialized] > 2380 | connector->state->privacy_screen_sw_state =3D sw_state; > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ > drivers/gpu/drm/drm_connector.c:2375:33: note: 'sw_state' was declared= here > 2375 | enum drm_privacy_screen_status sw_state, hw_state; > | ^~~~~~~~ >>> drivers/gpu/drm/drm_connector.c:2381:2: warning: 'hw_state' is used uni= nitialized in this function [-Wuninitialized] > 2381 | drm_object_property_set_value(&connector->base, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 2382 | connector->privacy_screen_hw_state_property, hw_state); > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/gpu/drm/drm_connector.c:2375:43: note: 'hw_state' was declared= here > 2375 | enum drm_privacy_screen_status sw_state, hw_state; It took me a couple of minutes to wrap my head around these warnings. The p= roblem is that if CONFIG_DRM_PRIVICAY_SCREEN is not set then drm_privacy_screen_get_state(= ) is an inline stub, which is a no-op. So the compiler is right in warning here. I'll make the stub actually set both to PRIVACY_SCREEN_DISABLED in v3 of the "drm: Add privacy-screen class" to squelch this warning when the stub is us= ed: diff --git a/include/drm/drm_privacy_screen_consumer.h b/include/drm/drm_pr= ivacy_screen_consumer.h index 31746a745439..7f66a90d15b7 100644 --- a/include/drm/drm_privacy_screen_consumer.h +++ b/include/drm/drm_privacy_screen_consumer.h @@ -47,6 +47,8 @@ static inline void drm_privacy_screen_get_state(struct dr= m_privacy_screen *priv, enum drm_privacy_screen_status *sw_state_ret, enum drm_privacy_screen_status *hw_state_ret) { + *sw_state_ret =3D PRIVACY_SCREEN_DISABLED; + *hw_state_ret =3D PRIVACY_SCREEN_DISABLED; } static inline int drm_privacy_screen_register_notifier(struct drm_privacy_= screen *priv, struct notifier_block *nb) I don't think it is worth sending out a new version of this series just for= this, so please review the current version. Regards, Hans > vim +/sw_state +2380 drivers/gpu/drm/drm_connector.c > = > 2371 = > 2372 static void drm_connector_update_privacy_screen_properties( > 2373 struct drm_connector *connector) > 2374 { > 2375 enum drm_privacy_screen_status sw_state, hw_state; > 2376 = > 2377 drm_privacy_screen_get_state(connector->privacy_screen, > 2378 &sw_state, &hw_state); > 2379 = >> 2380 connector->state->privacy_screen_sw_state =3D sw_state; >> 2381 drm_object_property_set_value(&connector->base, > 2382 connector->privacy_screen_hw_state_property, hw_state); > 2383 } > 2384 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org >=20 --===============1942235973497529933==--