CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: Denis Efremov <efre...@linux.com> CC: Julia Lawall <julia.law...@inria.fr> CC: Jaroslav Kysela <pe...@perex.cz> CC: Takashi Iwai <ti...@suse.com> CC: alsa-de...@alsa-project.org CC: linux-ker...@vger.kernel.org
From: kernel test robot <l...@intel.com> sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max() Check for opencoded min(), max() implementations. Generated patches sometimes require adding a cast to fix compile warning. Warnings/patches scope intentionally limited to a function body. Generated by: scripts/coccinelle/misc/minmax.cocci CC: Denis Efremov <efre...@linux.com> Reported-by: kernel test robot <l...@intel.com> Signed-off-by: kernel test robot <l...@intel.com> --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 52deda9551a01879b3562e7b41748e85c591f14c commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script :::::: branch date: 5 hours ago :::::: commit date: 11 months ago Please take the patch only if it's a positive warning. Thanks! sound/core/pcm_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -74,7 +74,7 @@ void snd_pcm_playback_silence(struct snd snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime); if (avail > runtime->buffer_size) avail = runtime->buffer_size; - runtime->silence_filled = avail > 0 ? avail : 0; + runtime->silence_filled = max(avail, 0); runtime->silence_start = (runtime->status->hw_ptr + runtime->silence_filled) % runtime->boundary; _______________________________________________ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org