[bug report] ASoC: mediatek: mt8188: support etdm in platform driver

Trevor Wu (吳文良) Trevor.Wu at mediatek.com
Mon Jan 30 18:26:39 PST 2023


On Mon, 2023-01-30 at 14:40 +0300, Dan Carpenter wrote:
> On Mon, Jan 30, 2023 at 09:25:52AM +0000, Trevor Wu (吳文良) wrote:
> > Hi Dan,
> > 
> > Thank you for catching that.
> > I didn't notice that snprintf() never returns a negative value in
> > kernel code.
> > It is possible that I misunderstood the coverity error message, but
> > I
> > can't find the original coverity scan result.
> > 
> > If I just remove the dead code, coverity will report some errors in
> > the
> > future.
> > As a result, I prefer to keep the line and add another check "ret
> > >=
> > sizeof(prop)", so that we can avoid the problem reported by
> > coverity
> > and Smatch.
> 
> Generally, when static checkers print nonsense warnings you should
> just
> ignore them instead of adding dead code so I would encourage to
> delete
> the dead code even though Coverity complains.  Fix what is broken
> instead of just working around it.
> 
> regards,
> dan carpenter
> 

Got it. I will prepare a patch and remove the dead code.

Thanks,
Trevor


More information about the Linux-mediatek mailing list