From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754275AbbJAPYA (ORCPT ); Thu, 1 Oct 2015 11:24:00 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:18447 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751649AbbJAPX6 (ORCPT ); Thu, 1 Oct 2015 11:23:58 -0400 Date: Thu, 1 Oct 2015 18:23:38 +0300 From: Dan Carpenter To: Lars Svensson Cc: thomas.petazzoni@free-electrons.com, noralf@tronnes.org, devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: fbtft: add typecast in call to vfree() Message-ID: <20151001152338.GI7340@mwanda> References: <1443704412-11795-1-git-send-email-lars1.svensson@sonymobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443704412-11795-1-git-send-email-lars1.svensson@sonymobile.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2015 at 03:00:12PM +0200, Lars Svensson wrote: > Member screen_base in struct fb_info is declared __iomem causing > a sparse warning as below when passed to vfree(). This adds typecast > (__force void *) to silence the warning. > > fbtft-core.c:922:39: warning: incorrect type in argument 1 \ > (different address spaces) > fbtft-core.c:922:39: expected void const *addr > fbtft-core.c:922:39: got char [noderef] *screen_base > I thought we were going to do something like this: diff --git a/include/linux/fb.h b/include/linux/fb.h index be40dba..3324c92 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -483,7 +483,10 @@ struct fb_info { #ifdef CONFIG_FB_TILEBLITTING struct fb_tile_ops *tileops; /* Tile Blitting */ #endif - char __iomem *screen_base; /* Virtual address */ + union { + char __iomem *screen_base; /* Virtual address */ + char *fake_screen_base; + }; unsigned long screen_size; /* Amount of ioremapped VRAM or 0 */ void *pseudo_palette; /* Fake palette of 16 colors */ #define FBINFO_STATE_RUNNING 0 The only question is what to call the fake_screen_base. regards, dan carpenter