From patchwork Wed Mar 18 19:04:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 6043531 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 819059F314 for ; Wed, 18 Mar 2015 19:06:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B04552042A for ; Wed, 18 Mar 2015 19:06:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE5E12026C for ; Wed, 18 Mar 2015 19:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756485AbbCRTGI (ORCPT ); Wed, 18 Mar 2015 15:06:08 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:35614 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755453AbbCRTFS (ORCPT ); Wed, 18 Mar 2015 15:05:18 -0400 Received: by wibdy8 with SMTP id dy8so98428959wib.0; Wed, 18 Mar 2015 12:05:16 -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=ECYHmq88tsLo7UJ1jHULNQrmhBQXW5kTVayafXd7v5U=; b=Ccw/z+0TQQLln2+FZIbRWMajrf/m2xfAMFFzr2IOi2AaLk9YP+rTPWXAfy+fy1k0tb orAhymOR/sljc0qCA2Zo7UepIqrTm2pLAbmIo4u0VhgEc1N26Di0HdvHxtHDNFeOLy/9 gielKvwNxuxDOd0LzKuMldJ8hZlbnu5Vg7y3Gsr59RBMBiG4mjqOvMIAFF5RlxEFzroC ngSVCobncS1+8y5mCjCTFZahxbWDytG4ECULYuVvEW1ypeIUZmmFTiYjBmOfyPSRKaLt 0qXYZ27bodXicudBaUH5rz+ZR73EQfaj/EUTn2lIari+lLDJECi/OQyFi2e7hAQJyR9r RZrg== X-Received: by 10.194.104.99 with SMTP id gd3mr140224568wjb.114.1426705516470; Wed, 18 Mar 2015 12:05:16 -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 cn10sm4374131wib.15.2015.03.18.12.05.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 12:05:15 -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 v2 4/5] staging: sm750fb: Fix __iomem pointer types Date: Wed, 18 Mar 2015 19:04:53 +0000 Message-Id: <1426705493-26615-2-git-send-email-lstoakes@gmail.com> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1426705493-26615-1-git-send-email-lstoakes@gmail.com> References: <1426705493-26615-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=ham 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 --- v2: Whitespace fixups 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