All of lore.kernel.org
 help / color / mirror / Atom feed
* re: gma500: initial medfield merge
@ 2015-05-19  9:24 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2015-05-19  9:24 UTC (permalink / raw)
  To: kirill.shutemov; +Cc: dri-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* re: gma500: initial medfield merge
@ 2013-11-08 10:05 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2013-11-08 10:05 UTC (permalink / raw)
  To: kernel-janitors

Hello Kirill A. Shutemov,

This is a semi-automatic email about new static checker warnings.

The patch 026abc333205: "gma500: initial medfield merge" from Mar 8, 
2012, leads to the following Smatch complaint:

drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c:541 __read_panel_data()
	 warn: variable dereferenced before check 'sender' (see line 536)

drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
   535		unsigned long flags;
   536		struct drm_device *dev = sender->dev;
                                         ^^^^^^^^^^^
Dereference.

   537		int i;
   538		u32 gen_data_reg;
   539		int retry = MDFLD_DSI_READ_MAX_COUNT;
   540	
   541		if (!sender || !data_out || !len_out) {
                    ^^^^^^^
Check.

   542			DRM_ERROR("Invalid parameters\n");
   543			return -EINVAL;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-19  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19  9:24 gma500: initial medfield merge Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2013-11-08 10:05 Dan Carpenter

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.