linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* staging/media/meson/vdec compiler warning: how to fix?
@ 2022-08-30  5:56 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2022-08-30  5:56 UTC (permalink / raw)
  To: Neil Armstrong, mjourdan; +Cc: linux-media

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-30  5:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30  5:56 staging/media/meson/vdec compiler warning: how to fix? Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).