Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6595430imm; Mon, 23 Jul 2018 22:50:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeqCefqGJ3DVbjDISQJSF+2vtJQ3hXsB1JsNThG0B6+q75/HZ/09dAJwBj0NBSHbyFi6hS2 X-Received: by 2002:a17:902:583:: with SMTP id f3-v6mr15793791plf.115.1532411457749; Mon, 23 Jul 2018 22:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532411457; cv=none; d=google.com; s=arc-20160816; b=b9u3UGGiNs2OOUhrd6D/BLavCx0xKozX9PUZHmPUz1AIITpCvoXfAxZZp9Ypa1iJLE c+euod+A0Dxrw9YQTOSOffcLiEnnmSQgv199rYdpiUhNeA/wvk1xO6bRIqSuYWSQgWH9 aVAyAkTqjtHHVKk63Bz6M5tXoV1o3eFtqB/9U76aWig2RQPkZQzr52wxibCurMH2jsW4 F9Dub8pLlWB+3XhGvze0IwxyVUaONwIfwm5hYNg/WGo4VM0hNdzaZUSqcw1YblQYk4cG QB2F9EU57f87//dqm0Mmi01I/8PDwbwBqATb6ksm6eB/fXOqgtkoG1FRz8MmQuWHQjdq TF7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=vr8SVRIXJi/lKsPQZpqq47XxddyI8cdpwCHyuT987uI=; b=OVpue63QmMcaF6eSGntqncFRTS1tzUYZK6I2cYXzE+wzC/9KfBetaZVal/12/+ZFTw oFmtBuAXGUGntCWCJKJKbgFf0f4J3+N6mWR9RGZATxLL2Dwy7wmxgOX85fiAIXRfZ10y i8Py9bP+IYHSLRZWVYzq93DHXStIfB2fdUVCq+QGmBZ9RNPF3RGDdvZs4HAkDMq6p2YR SCpNNdhqC+74diftsut+tCWLZFhKGe7okEXcNSQzkb+ZnR8slftb/AXN/3GSpOOK6ffx ORA52DgtmzbTxQtYxDEn75UzWXB/xnUiIjRcEgLaC/u+PbFpx/ZWLaDqvqfVMjHvPn/Y Po8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j85-v6si11815947pfa.232.2018.07.23.22.50.43; Mon, 23 Jul 2018 22:50:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388225AbeGXGyj (ORCPT + 99 others); Tue, 24 Jul 2018 02:54:39 -0400 Received: from mail.bootlin.com ([62.4.15.54]:45505 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388140AbeGXGyj (ORCPT ); Tue, 24 Jul 2018 02:54:39 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 3C0E6207B0; Tue, 24 Jul 2018 07:49:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id C7579206F6; Tue, 24 Jul 2018 07:49:51 +0200 (CEST) Date: Tue, 24 Jul 2018 07:49:51 +0200 From: Boris Brezillon To: Randy Dunlap Cc: LKML , Linux-sh list , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org, Yoshinori Sato , Rich Felker , Sergei Shtylyov Subject: Re: [PATCH v2] mtd/maps: fix solutionengine.c printk format warnings Message-ID: <20180724074951.62c49935@bbrezillon> In-Reply-To: <0ca72308-0551-97dc-dc74-11e1d8dac5b1@infradead.org> References: <0ca72308-0551-97dc-dc74-11e1d8dac5b1@infradead.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 22 Jul 2018 16:28:52 -0700 Randy Dunlap wrote: > From: Randy Dunlap > > Fix 2 printk format warnings (this driver is currently only used by > arch/sh/) by using "%pap" instead of "%lx". > (or we could just cast the physical addresses to unsigned int) > > Fixes these build warnings: > > ../drivers/mtd/maps/solutionengine.c: In function 'init_soleng_maps': > ../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] > ../drivers/mtd/maps/solutionengine.c:62:54: note: format string is defined here > printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n", > ~~~~^ > %08x > ../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] > ../drivers/mtd/maps/solutionengine.c:62:72: note: format string is defined here > printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n", > ~~~~^ > %08x > > Cc: David Woodhouse > Cc: Brian Norris > Cc: Boris Brezillon > Cc: Marek Vasut > Cc: Richard Weinberger > Cc: linux-mtd@lists.infradead.org > Cc: Yoshinori Sato > Cc: Rich Felker > Cc: linux-sh@vger.kernel.org > Cc: Sergei Shtylyov > > Signed-off-by: Randy Dunlap > --- > v2: indent all lines inside the new block > > drivers/mtd/maps/solutionengine.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > --- linux-next-20180717.orig/drivers/mtd/maps/solutionengine.c > +++ linux-next-20180717/drivers/mtd/maps/solutionengine.c > @@ -59,9 +59,14 @@ static int __init init_soleng_maps(void) > return -ENXIO; > } > } > - printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n", > - soleng_flash_map.phys & 0x1fffffff, > - soleng_eprom_map.phys & 0x1fffffff); Hm, not sure why masking with 0x1fffffff is required. It seems .phys is either 0 or 0x1000000, so maybe we should just go for printk(KERN_NOTICE "Solution Engine: Flash at 0x%pap, EPROM at 0x%pap\n", &soleng_flash_map.phys, &soleng_eprom_map.phys); > + { > + resource_size_t fl_phys = soleng_flash_map.phys & 0x1fffffff; > + resource_size_t ep_phys = soleng_eprom_map.phys & 0x1fffffff; > + > + printk(KERN_NOTICE > + "Solution Engine: Flash at 0x%pap, EPROM at 0x%pap\n", > + &fl_phys, &ep_phys); > + } > flash_mtd->owner = THIS_MODULE; > > eprom_mtd = do_map_probe("map_rom", &soleng_eprom_map); > >