From patchwork Fri Mar 20 15:22:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 6057691 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 D61579F399 for ; Fri, 20 Mar 2015 15:23:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AE6D20120 for ; Fri, 20 Mar 2015 15:23:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16B4120519 for ; Fri, 20 Mar 2015 15:23:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbbCTPXX (ORCPT ); Fri, 20 Mar 2015 11:23:23 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:34128 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbbCTPWk (ORCPT ); Fri, 20 Mar 2015 11:22:40 -0400 Received: by wegp1 with SMTP id p1so84721743weg.1; Fri, 20 Mar 2015 08:22:39 -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=LtDC3IVR1FGtJ/nr1Gk6qmkylJ+DHW+vqakUNLYLkLs=; b=l7h9PFv0KQXYuRen/cRmLL84h1PsYGVCDXb6OqPcbVZH+pYlkqa2ohMKHEY1o0jmHm V8+rP2kUUwjJeV2iBPMX6ck60ZqFuX3wQUxdMU2EUj1U0hLadkgItLWT8JS5JpB1mEWF 4GGVHwG0QTYC35hj4yVSCjFZJMwZE/1WyKlRcSUk5uuAUGBhfew7OxTZ3DlOfNCfwJp4 grSdn1U0WqLdvES4dbKEPAlWoCmyO/z5JcwN49Od9F8FStlqOPFMoevQz17hS9GdDNjN xuo7/wbS+UNLMwv6HhL2qnEHUWIhZJJlqZZzPPmMIKCKVW8Sh8/ZnGaa+/jhcGjDx9bI 3dIQ== X-Received: by 10.194.200.8 with SMTP id jo8mr130666039wjc.64.1426864959190; Fri, 20 Mar 2015 08:22:39 -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 f15sm489071wik.2.2015.03.20.08.22.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 08:22:38 -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 2 4/5] staging: sm750fb: Fix __iomem pointer types Date: Fri, 20 Mar 2015 15:22:14 +0000 Message-Id: <1426864935-29350-4-git-send-email-lstoakes@gmail.com> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1426864935-29350-1-git-send-email-lstoakes@gmail.com> References: <1426864935-29350-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