Re: OMAPDSS: HDMI: Add OMAP5 HDMI support

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

 



Hi Dan, Jyri,

On 03/12/14 14:22, Dan Carpenter wrote:
> Hello Tomi Valkeinen,
> 
> The patch f5bab2229190: "OMAPDSS: HDMI: Add OMAP5 HDMI support" from
> Mar 13, 2014, leads to the following static checker warning:
> 
> 	drivers/video/fbdev/omap2/dss/hdmi5_core.c:719 hdmi5_core_audio_config()
> 	warn: '(3) - (4)' negative one
> 
> Uh...  This is really weird, I have no idea what this warning is or why
> it's triggered.  I've even looked at the code which triggers it but that
> has no documentation.  :P  Still it seems like something worth looking
> into.

I presume it somehow is caused by this line in the dss.h:

#define FLD_MASK(start, end)	(((1 << ((start) - (end) + 1)) - 1) << (end))

But I don't quite see why the warnings happens. start=3 and end=4 should
produce valid code there, even if the end result is not what's expected...

> drivers/video/fbdev/omap2/dss/hdmi5_core.c
>    713          /* PCM audio mode */
>    714          val = (cfg->iec60958_cfg->status[0] & IEC958_AES0_CON_MODE) >> 6;
>    715          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(2), val, 6, 4);
>    716  
>    717          /* Source number */
>    718          val = cfg->iec60958_cfg->status[2] & IEC958_AES2_CON_SOURCE;
>    719          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(2), val, 3, 4);
>                                                                   ^^^^
> Aren't these reversed?  This seems like an invalid bitfield range.

Good catch! Indeed it's reversed.

Jyri, this is in the hdmi audio side. Can you check it out? Fix is
trivial, but I'd like to know if it has caused wrong configuration, and
if it has, why haven't we noticed anything.

 Tomi


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux