Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1531095

Re: virtio gpu sparse warning

From Gerd Hoffmann <kraxel@redhat.com>
Newsgroups linux.kernel
Subject Re: virtio gpu sparse warning
Date 2016-11-28 09:00 +0100
Message-ID <sIp10-7EQ-19@gated-at.bofh.it> (permalink)
References (1 earlier) <sBllw-5TP-25@gated-at.bofh.it> <sBw7f-4HJ-15@gated-at.bofh.it> <sCmSd-6F5-19@gated-at.bofh.it> <sE8i6-3kM-1@gated-at.bofh.it> <sGSqt-4QG-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Do, 2016-11-24 at 04:57 +0200, Michael S. Tsirkin wrote:
> sparse produces these warnings:
> 
> drivers/gpu/drm/virtio/virtgpu_fb.c:340:27: warning: incorrect type in
> assignment (different address spaces)
> drivers/gpu/drm/virtio/virtgpu_fb.c:340:27:    expected char [noderef]
> <asn:2>*screen_base
> drivers/gpu/drm/virtio/virtgpu_fb.c:340:27:    got void *vmap
> 
> This is because the expected type is void __iomem *, while
> virtio gpu object is void *vmap.
> 
> We could just cast the warning away but I'm not sure this
> is not a symptom of an actual problem. For example, might
> some code call iounmap on this address?

Nobody is ever going to unmap that, the kernel will simply use given
address to access the framebuffer.

Actually it looks like this (in include/linux/fb.h):

        union {
                char __iomem *screen_base;      /* Virtual address */
                char *screen_buffer;
        };

and given that the virtio always uses normal ram as backing storage for
the framebuffer we should simply s/screen_base/screen_buffer/.  I'll go
prepare a patch.

cheers,
  Gerd

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: virtio gpu sparse warning Gerd Hoffmann <kraxel@redhat.com> - 2016-11-28 09:00 +0100

csiph-web