staging/media/meson/vdec compiler warning: how to fix?

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

 



Hi Maxime, Neil,

After upgrading to gcc-12.2 I now get this warning from gcc:

git/drivers/staging/media/meson/vdec/codec_vp9.c:2115:3:
drivers/staging/media/meson/vdec/codec_vp9.c:1689:41: warning: 'coef_node_start' may be used uninitialized [-Wmaybe-uninitialized]
 1689 |                         coef_node_start = coef_node_start + 1;
      |                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
drivers/staging/media/meson/vdec/codec_vp9.c: In function 'codec_vp9_threaded_isr':
drivers/staging/media/meson/vdec/codec_vp9.c:1551:19: note: 'coef_node_start' was declared here
 1551 |         int node, coef_node_start, coef_count_node_start;
      |                   ^~~~~~~~~~~~~~~

coef_node_start can indeed be uninitialized because in the adapt_coef_probs()
function there is no final 'else' clause in the coef_count_node_start for-loop.

I can't tell if it should be there or if it is sufficient to just init
coef_node_start to 0.

A patch is welcome!

Regards,

	Hans



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux