All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-fbdev@vger.kernel.org
Subject: re: fbdev: sh_mobile_lcdc: Implement overlays support
Date: Fri, 13 Mar 2015 10:07:37 +0000	[thread overview]
Message-ID: <20150313100737.GA1984@mwanda> (raw)

Hello Laurent Pinchart,

The patch c5deac3c9b22: "fbdev: sh_mobile_lcdc: Implement overlays
support" from Dec 12, 2011, leads to the following static checker
warning:

	drivers/video/fbdev/sh_mobile_lcdcfb.c:1471 overlay_rop3_store()
	warn: bool comparison is always 'false'

drivers/video/fbdev/sh_mobile_lcdcfb.c
  1455  static ssize_t
  1456  overlay_rop3_store(struct device *dev, struct device_attribute *attr,
  1457                      const char *buf, size_t count)
  1458  {
  1459          struct fb_info *info = dev_get_drvdata(dev);
  1460          struct sh_mobile_lcdc_overlay *ovl = info->par;
  1461          unsigned int rop3;
  1462          char *endp;
  1463  
  1464          rop3 = !!simple_strtoul(buf, &endp, 10);
                       ^^
rop3 is true/false.

  1465          if (isspace(*endp))
  1466                  endp++;
  1467  
  1468          if (endp - buf != count)
  1469                  return -EINVAL;
  1470  
  1471          if (rop3 > 255)
                    ^^^^^^^^^^
This condition is never true.  Should we just delete it?

  1472                  return -EINVAL;
  1473  
  1474          if (ovl->rop3 != rop3) {
  1475                  ovl->rop3 = rop3;
  1476  
  1477                  if (ovl->mode = LCDC_OVERLAY_ROP3 && ovl->enabled)
  1478                          sh_mobile_lcdc_overlay_setup(ovl);
  1479          }
  1480  
  1481          return count;
  1482  }

regards,
dan carpenter

             reply	other threads:[~2015-03-13 10:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 10:07 Dan Carpenter [this message]
2015-03-13 15:45 ` fbdev: sh_mobile_lcdc: Implement overlays support Geert Uytterhoeven

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=20150313100737.GA1984@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-fbdev@vger.kernel.org \
    /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.