Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757872Ab3EJR6u (ORCPT ); Fri, 10 May 2013 13:58:50 -0400 Received: from sauhun.de ([89.238.76.85]:55983 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753652Ab3EJR6t (ORCPT ); Fri, 10 May 2013 13:58:49 -0400 Date: Fri, 10 May 2013 20:00:12 +0200 From: Wolfram Sang To: Alan Stern Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: Re: [RFC 30/42] drivers/usb/host: don't check resource with devm_ioremap_resource Message-ID: <20130510180007.GC2912@katana> References: <1368173847-5661-31-git-send-email-wsa@the-dreams.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2040 Lines: 51 On Fri, May 10, 2013 at 10:03:28AM -0400, Alan Stern wrote: > On Fri, 10 May 2013, Wolfram Sang wrote: > > > devm_ioremap_resource does sanity checks on the given resource. No need to > > duplicate this in the driver. > > > > Signed-off-by: Wolfram Sang > > --- > > drivers/usb/host/ehci-atmel.c | 9 +-------- > > drivers/usb/host/ehci-mxc.c | 8 +------- > > drivers/usb/host/ehci-platform.c | 6 +----- > > drivers/usb/host/ehci-sh.c | 10 +--------- > > drivers/usb/host/ohci-nxp.c | 6 ------ > > drivers/usb/host/ohci-platform.c | 7 +------ > > 6 files changed, 5 insertions(+), 41 deletions(-) > > > > diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c > > index 6642009..62bf3e6 100644 > > --- a/drivers/usb/host/ehci-atmel.c > > +++ b/drivers/usb/host/ehci-atmel.c > > @@ -101,17 +101,10 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) > > goto fail_create_hcd; > > } > > > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > - if (!res) { > > - dev_err(&pdev->dev, > > - "Found HC with no register addr. Check %s setup!\n", > > - dev_name(&pdev->dev)); > > - retval = -ENODEV; > > - goto fail_request_resource; > > - } > > hcd->rsrc_start = res->start; > > hcd->rsrc_len = resource_size(res); > > > > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > hcd->regs = devm_ioremap_resource(&pdev->dev, res); > > This isn't right. You are now dereferencing an uninitialized pointer > in the assignment to hcd->rsrc_start. The compiler won't like that. > > Most of the other changes in this patch suffer from the same problem. I broke the detection of dereferencing and compile tested an unaffected kernel. Thanks for pointing out. Will fix! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/