<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 26, 2018, 04:49 Dan Carpenter <<a href="mailto:dan.carpenter@oracle.com">dan.carpenter@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Ben Skeggs,<br>
<br>
The patch a9c44a88ca2f: "drm/nouveau/disp/nv50-: add channel<br>
interfaces to control error interrupts" from May 8, 2018, leads to<br>
the following static checker warning:<br>
<br>
        drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c:169 nv50_disp_chan_intr()<br>
        warn: should '65537 << chan->chid.user' be a 64 bit type?<br>
<br>
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c<br>
   165  void<br>
   166  nv50_disp_chan_intr(struct nv50_disp_chan *chan, bool en)<br>
   167  {<br>
   168          struct nvkm_device *device = chan->disp->base.engine.subdev.device;<br>
   169          const u64 mask = 0x00010001 << chan->chid.user;<br>
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
Can this shift wrap?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This should be a u32, not u64. Same for mask below. The value of user is <16.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
   170          const u64 data = en ? 0x00010000 : 0x00000000;<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Ben, is this a bug? Shouldn't this also be shifted?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   171          nvkm_mask(device, 0x610028, mask, data);</blockquote></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   172  }<br>
<br>
regards,<br>
dan carpenter<br>
_______________________________________________<br>
Nouveau mailing list<br>
<a href="mailto:Nouveau@lists.freedesktop.org" target="_blank" rel="noreferrer">Nouveau@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/nouveau" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/nouveau</a><br>
</blockquote></div></div></div>