dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kirill.shutemov@linux.intel.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: gma500: initial medfield merge
Date: Tue, 19 May 2015 12:24:06 +0300	[thread overview]
Message-ID: <20150519092406.GA3634@mwanda> (raw)

Hello Kirill A. Shutemov,

The patch 026abc333205: "gma500: initial medfield merge" from Mar 8,
2012, leads to the following static checker warning:

	drivers/gpu/drm/gma500/mdfld_intel_display.c:102 mdfldWaitForPipeEnable()
	warn: masked condition '(temp & (1 << 30)) == 1' is always false.

drivers/gpu/drm/gma500/mdfld_intel_display.c
    79  void mdfldWaitForPipeEnable(struct drm_device *dev, int pipe)
    80  {
    81          struct drm_psb_private *dev_priv = dev->dev_private;
    82          const struct psb_offset *map = &dev_priv->regmap[pipe];
    83          int count, temp;
    84  
    85          switch (pipe) {
    86          case 0:
    87          case 1:
    88          case 2:
    89                  break;
    90          default:
    91                  DRM_ERROR("Illegal Pipe Number.\n");
    92                  return;
    93          }
    94  
    95          /* FIXME JLIU7_PO */
    96          gma_wait_for_vblank(dev);
    97          return;
    98  
    99          /* Wait for for the pipe enable to take effect. */
   100          for (count = 0; count < COUNT_MAX; count++) {
   101                  temp = REG_READ(map->conf);
   102                  if ((temp & PIPEACONF_PIPE_STATE) == 1)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Never true.  It meants we always loop until the timeout.  I am tempted
to change it to:

			if (temp & PIPEACONF_PIPE_STATE)

But removing delays is slightly risky unless you can test it on
hardware.

   103                          break;
   104          }
   105  }

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

                 reply	other threads:[~2015-05-19  9:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20150519092406.GA3634@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kirill.shutemov@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox