Re: [PATCH v4 07/13] ASoC: codecs: wcd: add common helper for wcd codecs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




On 9/8/25 11:40 AM, kernel test robot wrote:
> Hi Srinivas,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on broonie-sound/for-next]
> [also build test WARNING on linus/master v6.17-rc5 next-20250905]
> [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#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Srinivas-Kandagatla/ASoC-codecs-wcd937x-set-the-comp-soundwire-port-correctly/20250907-192533
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
> patch link:    https://lore.kernel.org/r/20250907112201.259405-8-srinivas.kandagatla%40oss.qualcomm.com
> patch subject: [PATCH v4 07/13] ASoC: codecs: wcd: add common helper for wcd codecs
> config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20250908/202509081839.R4vv3FST-lkp@xxxxxxxxx/config)
> compiler: or1k-linux-gcc (GCC) 15.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250908/202509081839.R4vv3FST-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202509081839.R4vv3FST-lkp@xxxxxxxxx/
> 
> All warnings (new ones prefixed by >>):
> 
>    sound/soc/codecs/wcd-common.c: In function 'wcd_dt_parse_micbias_info':
>>> sound/soc/codecs/wcd-common.c:34:51: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
>       34 |         sprintf(micbias, "qcom,micbias%d-microvolt", micb_num);
>          |                                                   ^
>    In function 'wcd_get_micbias_val',
>        inlined from 'wcd_dt_parse_micbias_info' at sound/soc/codecs/wcd-common.c:61:26:
>    sound/soc/codecs/wcd-common.c:34:9: note: 'sprintf' output between 24 and 33 bytes into a destination of size 32

thanks, this is really nice static analysis,
fixed in v5.

--srini
>       34 |         sprintf(micbias, "qcom,micbias%d-microvolt", micb_num);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> vim +/sprintf +34 sound/soc/codecs/wcd-common.c
> 
>     28	
>     29	static int wcd_get_micbias_val(struct device *dev, int micb_num, u32 *micb_mv)
>     30	{
>     31		char micbias[32];
>     32		int mv;
>     33	
>   > 34		sprintf(micbias, "qcom,micbias%d-microvolt", micb_num);
>     35	
>     36		if (of_property_read_u32(dev->of_node, micbias, &mv)) {
>     37			dev_err(dev, "%s value not found, using default\n", micbias);
>     38			mv = WCD_DEF_MICBIAS_MV;
>     39		} else {
>     40			/* convert it to milli volts */
>     41			mv = mv/1000;
>     42		}
>     43		if (micb_mv)
>     44			*micb_mv = mv;
>     45	
>     46		mv = wcd_get_micb_vout_ctl_val(dev, mv);
>     47		if (mv < 0) {
>     48			dev_err(dev, "Unsupported %s voltage (%d mV), falling back to default (%d mV)\n",
>     49					micbias, mv, WCD_DEF_MICBIAS_MV);
>     50			return wcd_get_micb_vout_ctl_val(dev, WCD_DEF_MICBIAS_MV);
>     51		}
>     52	
>     53		return mv;
>     54	}
>     55	
> 





[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux