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, 19 Mar 2015 12:49:48 +0300 [thread overview]
Message-ID: <20150319094948.GA10407@mwanda> (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/nvkm/engine/disp/vga.c:41 nv_rdport()
warn: we tested 'port == 962' before and it was 'false'
drivers/gpu/drm/nouveau/nvkm/engine/disp/vga.c:66 nv_wrport()
warn: we tested 'port == 962' before and it was 'false'
drivers/gpu/drm/nouveau/nvkm/engine/disp/vga.c
29 nv_rdport(void *obj, int head, u16 port)
30 {
31 struct nvkm_device *device = nv_device(obj);
32
33 if (device->card_type >= NV_50)
34 return nv_rd08(obj, 0x601000 + port);
35
36 if (port == 0x03c0 || port == 0x03c1 || /* AR */
37 port == 0x03c2 || port == 0x03da || /* INP0 */
^^^^^^
We return here.
38 port == 0x03d4 || port == 0x03d5) /* CR */
39 return nv_rd08(obj, 0x601000 + (head * 0x2000) + port);
40
41 if (port == 0x03c2 || port == 0x03cc || /* MISC */
^^^^^^
Duplicate. Probably one of these is a typo but I don't know which.
42 port == 0x03c4 || port == 0x03c5 || /* SR */
43 port == 0x03ce || port == 0x03cf) { /* GR */
44 if (device->card_type < NV_40)
45 head = 0; /* CR44 selects head */
46 return nv_rd08(obj, 0x0c0000 + (head * 0x2000) + port);
47 }
48
49 nv_error(obj, "unknown vga port 0x%04x\n", port);
50 return 0x00;
51 }
52
53 void
54 nv_wrport(void *obj, int head, u16 port, u8 data)
55 {
56 struct nvkm_device *device = nv_device(obj);
57
58 if (device->card_type >= NV_50)
59 nv_wr08(obj, 0x601000 + port, data);
60 else
61 if (port == 0x03c0 || port == 0x03c1 || /* AR */
62 port == 0x03c2 || port == 0x03da || /* INP0 */
^^^^^^
63 port == 0x03d4 || port == 0x03d5) /* CR */
64 nv_wr08(obj, 0x601000 + (head * 0x2000) + port, data);
65 else
66 if (port == 0x03c2 || port == 0x03cc || /* MISC */
^^^^^^
Same thing.
67 port == 0x03c4 || port == 0x03c5 || /* SR */
68 port == 0x03ce || port == 0x03cf) { /* GR */
69 if (device->card_type < NV_40)
70 head = 0; /* CR44 selects head */
71 nv_wr08(obj, 0x0c0000 + (head * 0x2000) + port, data);
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2015-03-19 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 9:49 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-02-13 9:51 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=20150319094948.GA10407@mwanda \
--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