public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Kapshuk <alexander.kapshuk@gmail.com>
To: gregkh@linuxfoundation.org, hdegoede@redhat.com,
	michael.thayer@oracle.com, dri-devel@lists.freedesktop.org
Cc: peda@axentia.se, daniel.vetter@ffwll.ch, cakturk@gmail.com,
	seanpaul@chromium.org, linux-kernel@vger.kernel.org,
	alexander.kapshuk@gmail.com
Subject: [PATCH] vboxvideo: Fix incorrect type in assignment sparse warning
Date: Mon, 25 Dec 2017 16:42:59 +0200	[thread overview]
Message-ID: <20171225144259.17070-1-alexander.kapshuk@gmail.com> (raw)

Sparse emitted the following warning:
../drivers/staging/vboxvideo/vbox_fb.c:173:27: warning: incorrect type in assignment (different address spaces)
../drivers/staging/vboxvideo/vbox_fb.c:173:27:    expected char [noderef] <asn:2>*screen_base
../drivers/staging/vboxvideo/vbox_fb.c:173:27:    got void *virtual

The vbox_bo buffer object kernel mapping is handled by a call
to ttm_bo_kmap() prior to the assignment of bo->kmap.virtual to
info->screen_base of type char __iomem*.
Casting bo->kmap.virtual to char __iomem* in this assignment fixes
the warning.

vboxvideo: Fix address space of expression removal sparse warning

Sparse emitted the following warning:
../drivers/staging/vboxvideo/vbox_main.c:64:25: warning: cast removes address space of expression

vbox->vbva_buffers iomapping is handled by calling vbox_accel_init()
from vbox_hw_init().
__force attribute is used in assignment to vbva to fix the warning.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
---
 drivers/staging/vboxvideo/vbox_fb.c   | 2 +-
 drivers/staging/vboxvideo/vbox_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c
index 8aed248db6e2..43c39eca4ae1 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -170,7 +170,7 @@ static int vboxfb_create(struct drm_fb_helper *helper,
 	drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,
 			       sizes->fb_height);

-	info->screen_base = bo->kmap.virtual;
+	info->screen_base = (char __iomem *)bo->kmap.virtual;
 	info->screen_size = size;

 #ifdef CONFIG_DRM_KMS_FB_HELPER
diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c
index 80bd039fa08e..973b3bcc04b1 100644
--- a/drivers/staging/vboxvideo/vbox_main.c
+++ b/drivers/staging/vboxvideo/vbox_main.c
@@ -61,7 +61,7 @@ void vbox_enable_accel(struct vbox_private *vbox)
 		if (vbox->vbva_info[i].vbva)
 			continue;

-		vbva = (void *)vbox->vbva_buffers + i * VBVA_MIN_BUFFER_SIZE;
+		vbva = (void __force *)vbox->vbva_buffers + i * VBVA_MIN_BUFFER_SIZE;
 		if (!vbva_enable(&vbox->vbva_info[i],
 				 vbox->guest_pool, vbva, i)) {
 			/* very old host or driver error. */
--
2.13.6

             reply	other threads:[~2017-12-25 14:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-25 14:42 Alexander Kapshuk [this message]
2018-01-06 14:20 ` [PATCH] vboxvideo: Fix incorrect type in assignment sparse warning Alexander Kapshuk
2018-01-06 16:00   ` Hans de Goede
  -- strict thread matches above, loose matches on Subject: below --
2018-01-06 19:30 Alexander Kapshuk
2018-01-06 19:43 ` Hans de Goede
2018-01-06 19:56   ` Alexander Kapshuk
2018-01-06 20:00     ` Hans de Goede
2018-01-06 20:02       ` Alexander Kapshuk

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=20171225144259.17070-1-alexander.kapshuk@gmail.com \
    --to=alexander.kapshuk@gmail.com \
    --cc=cakturk@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.thayer@oracle.com \
    --cc=peda@axentia.se \
    --cc=seanpaul@chromium.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