From patchwork Fri Jan 15 18:25:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 42986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B8B11B7C31 for ; Sat, 16 Jan 2010 05:31:20 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NVqrn-0002Rl-0t; Fri, 15 Jan 2010 18:25:51 +0000 Received: from [206.15.93.42] (helo=visionfs1.visionengravers.com) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NVqrf-0002Pz-R5 for linux-mtd@lists.infradead.org; Fri, 15 Jan 2010 18:25:48 +0000 From: H Hartley Sweeten To: Linux Kernel , linux-mtd@lists.infradead.org Subject: [PATCH] mtdchar.c: fix different address space noise Date: Fri, 15 Jan 2010 11:25:38 -0700 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201001151125.39100.hartleys@visionengravers.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100115_132544_216363_522A2A62 X-CRM114-Status: GOOD ( 10.13 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.1 RDNS_NONE Delivered to trusted network by a host with no rDNS Cc: dwmw2@infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org mtdchar.c: fix different address space noise In mtd_ioctl MEMGETREGIONINFO the region_user_info pointer ur is cast in __kernel space. This produces a number of sparse warnings like: warning: cast removes address space of expression warning: incorrect type in initializer (different address spaces) expected unsigned int const [noderef] *register __p got unsigned int * Since argp is already a void __user * just use it dirrectly without the cast and make ur a __user *. Signed-off-by: H Hartley Sweeten Cc: David Woodhouse diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 5b081cb..0a85085 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -482,7 +482,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, { uint32_t ur_idx; struct mtd_erase_region_info *kr; - struct region_info_user *ur = (struct region_info_user *) argp; + struct region_info_user __user *ur = argp; if (get_user(ur_idx, &(ur->regionindex))) return -EFAULT;