All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: tomi.valkeinen@ti.com
Cc: linux-omap@vger.kernel.org
Subject: re: OMAPDSS: HDMI: Add OMAP5 HDMI support
Date: Wed, 3 Dec 2014 15:22:02 +0300	[thread overview]
Message-ID: <20141203122202.GA7398@mwanda> (raw)

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.

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.

   720  
   721          /* Channel number right 0  */
   722          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(3), 2, 3, 0);
   723          /* Channel number right 1*/
   724          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(3), 4, 7, 4);
   725          /* Channel number right 2  */
   726          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(4), 6, 3, 0);
   727          /* Channel number right 3*/
   728          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(4), 8, 7, 4);
   729          /* Channel number left 0  */
   730          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(5), 1, 3, 0);
   731          /* Channel number left 1*/
   732          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(5), 3, 7, 4);
   733          /* Channel number left 2  */
   734          REG_FLD_MOD(base, HDMI_CORE_FC_AUDSCHNLS(6), 5, 3, 0);
   735          /* Channel number left 3*/

regards,
dan carpenter

             reply	other threads:[~2014-12-03 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 12:22 Dan Carpenter [this message]
2014-12-03 12:42 ` OMAPDSS: HDMI: Add OMAP5 HDMI support Tomi Valkeinen
2014-12-03 15:05   ` Jyri Sarha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141203122202.GA7398@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.