From patchwork Wed Mar 18 08:57:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 6037121 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B29C3BF90F for ; Wed, 18 Mar 2015 08:58:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D41A52028D for ; Wed, 18 Mar 2015 08:58:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D597C203EB for ; Wed, 18 Mar 2015 08:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755225AbbCRI6A (ORCPT ); Wed, 18 Mar 2015 04:58:00 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:33690 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755107AbbCRI5u (ORCPT ); Wed, 18 Mar 2015 04:57:50 -0400 Received: by weop45 with SMTP id p45so26648609weo.0; Wed, 18 Mar 2015 01:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nSWhwUB9LLLkDhgRnDU3J4DbwQQ9IrCNzM3QN0PJTf0=; b=PE3iqILZRklRJ9IhL9SltgC+/Ptd/ja4wWyliVY7qT4Lult5R4LsC5ztawU5cRgzl8 sr8pFhQowHvkiRjIa10nltp+kwsqZsa0aPdXDyeUSnc6pP0O5oTC2iBwYaccUg01/oY1 HFT9CL8rzyx1DzZ0F39cFf+hEHY7fb29gGomux7BBGJGnk8QyDDQ3Mt7ctxu124czS8m peO0NlcZtTUvEYYFfOS9bMMwlFc9n33NamFmHkoxj9wgHvrEsu8pusZ0FhW1NxnQB8Vo nQXVJ3glQW4ZFKTsnB/4Cfmj1E6zs3Ugiv7vbQ4LIEu3n6LRHgyNhKYuqhT+3LK6aDbo jtnw== X-Received: by 10.180.90.211 with SMTP id by19mr4898023wib.27.1426669069106; Wed, 18 Mar 2015 01:57:49 -0700 (PDT) Received: from localhost (cpc71925-newt30-2-0-cust4.19-3.cable.virginm.net. [82.35.188.5]) by mx.google.com with ESMTPSA id 17sm23492059wjt.45.2015.03.18.01.57.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 01:57:48 -0700 (PDT) From: Lorenzo Stoakes To: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org Cc: linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Lorenzo Stoakes Subject: [PATCH RESEND 4/5] staging: sm750fb: Fix __iomem pointer types Date: Wed, 18 Mar 2015 08:57:25 +0000 Message-Id: <1426669046-29935-4-git-send-email-lstoakes@gmail.com> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1426669046-29935-1-git-send-email-lstoakes@gmail.com> References: <1426669046-29935-1-git-send-email-lstoakes@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch annotates pointers as referring to I/O mapped memory where they ought to be, removes now unnecessary ugly casts, eliminates an incorrect deref on I/O mapped memory by using iowrite16 instead, and updates the pointer arithmetic accordingly to take into account that the pointers are now byte-sized. This fixes the following sparse warnings:- drivers/staging/sm750fb/sm750_cursor.c:113:19: warning: cast removes address space of expression drivers/staging/sm750fb/sm750_cursor.c:204:19: warning: cast removes address space of expression Signed-off-by: Lorenzo Stoakes --- drivers/staging/sm750fb/sm750_cursor.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) -- 2.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 6cceef1..c2ff3bd 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -98,7 +98,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor, int i,j,count,pitch,offset; u8 color,mask,opr; u16 data; - u16 * pbuffer,*pstart; + void __iomem * pbuffer,*pstart; /* in byte*/ pitch = cursor->w >> 3; @@ -106,11 +106,11 @@ void hw_cursor_setData(struct lynx_cursor * cursor, /* in byte */ count = pitch * cursor->h; - /* in ushort */ - offset = cursor->maxW * 2 / 8 / 2; + /* in byte */ + offset = cursor->maxW * 2 / 8; data = 0; - pstart = (u16 *)cursor->vstart; + pstart = cursor->vstart; pbuffer = pstart; /* @@ -161,7 +161,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor, } } #endif - *pbuffer = data; + iowrite16(data, pbuffer); /* assume pitch is 1,2,4,8,...*/ #if 0 @@ -174,7 +174,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor, pstart += offset; pbuffer = pstart; }else{ - pbuffer++; + pbuffer += sizeof(u16); } } @@ -189,7 +189,7 @@ void hw_cursor_setData2(struct lynx_cursor * cursor, int i,j,count,pitch,offset; u8 color, mask; u16 data; - u16 * pbuffer,*pstart; + void __iomem * pbuffer,*pstart; /* in byte*/ pitch = cursor->w >> 3; @@ -197,11 +197,11 @@ void hw_cursor_setData2(struct lynx_cursor * cursor, /* in byte */ count = pitch * cursor->h; - /* in ushort */ - offset = cursor->maxW * 2 / 8 / 2; + /* in byte */ + offset = cursor->maxW * 2 / 8; data = 0; - pstart = (u16 *)cursor->vstart; + pstart = cursor->vstart; pbuffer = pstart; for(i=0;i