dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: bskeggs@redhat.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/nouveau/i2c: port to subdev interfaces
Date: Thu, 13 Feb 2014 12:51:26 +0300	[thread overview]
Message-ID: <20140213095125.GA27408@elgon.mountain> (raw)

Hello Ben Skeggs,

The patch 4196faa86232: "drm/nouveau/i2c: port to subdev interfaces"
from Jul 10, 2012, leads to the following static checker warning:

	drivers/gpu/drm/nouveau/core/engine/disp/vga.c:42 nv_rdport()
	warn: we tested 'port == 962' before and it was 'false'

drivers/gpu/drm/nouveau/core/engine/disp/vga.c
    30  nv_rdport(void *obj, int head, u16 port)
    31  {
    32          struct nouveau_device *device = nv_device(obj);
    33  
    34          if (device->card_type >= NV_50)
    35                  return nv_rd08(obj, 0x601000 + port);
    36  
    37          if (port == 0x03c0 || port == 0x03c1 || /* AR */
    38              port == 0x03c2 || port == 0x03da || /* INP0 */
                            ^^^^^^
    39              port == 0x03d4 || port == 0x03d5)   /* CR */
    40                  return nv_rd08(obj, 0x601000 + (head * 0x2000) + port);
    41  
    42          if (port == 0x03c2 || port == 0x03cc || /* MISC */
                            ^^^^^^
This can never be true because we returned already.

    43              port == 0x03c4 || port == 0x03c5 || /* SR */
    44              port == 0x03ce || port == 0x03cf) { /* GR */
    45                  if (device->card_type < NV_40)
    46                          head = 0; /* CR44 selects head */
    47                  return nv_rd08(obj, 0x0c0000 + (head * 0x2000) + port);
    48          }
    49  
    50          nv_error(obj, "unknown vga port 0x%04x\n", port);
    51          return 0x00;
    52  }
    53  
    54  void
    55  nv_wrport(void *obj, int head, u16 port, u8 data)
    56  {
    57          struct nouveau_device *device = nv_device(obj);
    58  
    59          if (device->card_type >= NV_50)
    60                  nv_wr08(obj, 0x601000 + port, data);
    61          else
    62          if (port == 0x03c0 || port == 0x03c1 || /* AR */
    63              port == 0x03c2 || port == 0x03da || /* INP0 */
                            ^^^^^^
    64              port == 0x03d4 || port == 0x03d5)   /* CR */
    65                  nv_wr08(obj, 0x601000 + (head * 0x2000) + port, data);
    66          else
    67          if (port == 0x03c2 || port == 0x03cc || /* MISC */
                            ^^^^^^
Same issue.

    68              port == 0x03c4 || port == 0x03c5 || /* SR */
    69              port == 0x03ce || port == 0x03cf) { /* GR */
    70                  if (device->card_type < NV_40)
    71                          head = 0; /* CR44 selects head */
    72                  nv_wr08(obj, 0x0c0000 + (head * 0x2000) + port, data);
    73          } else


regards,
dan carpenter

             reply	other threads:[~2014-02-13  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13  9:51 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-19  9:49 drm/nouveau/i2c: port to subdev interfaces Dan Carpenter

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=20140213095125.GA27408@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox