Content-Type: multipart/mixed; boundary="===============1430625893763393351==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH v12 2/2] leds: Add driver for Qualcomm LPG Date: Fri, 18 Feb 2022 11:06:56 +0800 Message-ID: <202202181023.H7VNk5J7-lkp@intel.com> In-Reply-To: <20220216045620.1716537-2-bjorn.andersson@linaro.org> List-Id: --===============1430625893763393351== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Bjorn, I love your patch! Perhaps something to improve: [auto build test WARNING on pavel-leds/for-next] [also build test WARNING on robh/for-next linus/master v5.17-rc4 next-20220= 217] [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/Bjorn-Andersson/dt-binding= s-leds-Add-Qualcomm-Light-Pulse-Generator-binding/20220216-125508 base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git = for-next config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/202202= 18/202202181023.H7VNk5J7-lkp(a)intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0e628a= 783b935c70c80815db6c061ec84f884af5) reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/88352f2526296902090ed67f8= b07f3fa348dad57 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Bjorn-Andersson/dt-bindings-leds-A= dd-Qualcomm-Light-Pulse-Generator-binding/20220216-125508 git checkout 88352f2526296902090ed67f8b07f3fa348dad57 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D= 1 O=3Dbuild_dir ARCH=3Dx86_64 SHELL=3D/bin/bash drivers/leds/rgb/ drivers/n= et/ethernet/mellanox/mlxsw/ mm/damon/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/leds/rgb/leds-qcom-lpg.c:920:6: warning: variable 'ret' is used = uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (state->enabled) { ^~~~~~~~~~~~~~ drivers/leds/rgb/leds-qcom-lpg.c:936:9: note: uninitialized use occurs h= ere return ret; ^~~ drivers/leds/rgb/leds-qcom-lpg.c:920:2: note: remove the 'if' if its con= dition is always true if (state->enabled) { ^~~~~~~~~~~~~~~~~~~~ drivers/leds/rgb/leds-qcom-lpg.c:913:9: note: initialize the variable 'r= et' to silence this warning int ret; ^ =3D 0 1 warning generated. vim +920 drivers/leds/rgb/leds-qcom-lpg.c 900 = 901 /* 902 * Limitations: 903 * - Updating both duty and period is not done atomically, so the ou= tput signal 904 * will momentarily be a mix of the settings. 905 * - Changed parameters takes effect immediately. 906 * - A disabled channel outputs a logical 0. 907 */ 908 static int lpg_pwm_apply(struct pwm_chip *chip, struct pwm_device *p= wm, 909 const struct pwm_state *state) 910 { 911 struct lpg *lpg =3D container_of(chip, struct lpg, pwm); 912 struct lpg_channel *chan =3D &lpg->channels[pwm->hwpwm]; 913 int ret; 914 = 915 if (state->polarity !=3D PWM_POLARITY_NORMAL) 916 return -EINVAL; 917 = 918 mutex_lock(&lpg->lock); 919 = > 920 if (state->enabled) { 921 ret =3D lpg_calc_freq(chan, state->period); 922 if (ret < 0) 923 goto out_unlock; 924 = 925 lpg_calc_duty(chan, state->duty_cycle); 926 } 927 chan->enabled =3D state->enabled; 928 = 929 lpg_apply(chan); 930 = 931 triled_set(lpg, chan->triled_mask, chan->enabled ? chan->triled_mas= k : 0); 932 = 933 out_unlock: 934 mutex_unlock(&lpg->lock); 935 = 936 return ret; 937 } 938 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============1430625893763393351==--