Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760929AbZLKSvx (ORCPT ); Fri, 11 Dec 2009 13:51:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758941AbZLKSvt (ORCPT ); Fri, 11 Dec 2009 13:51:49 -0500 Received: from exprod6og104.obsmtp.com ([64.18.1.187]:36913 "EHLO exprod6og104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758394AbZLKSvs (ORCPT ); Fri, 11 Dec 2009 13:51:48 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Subject: RE: [PATCH] i2c-iop3xx.c: fix memory resource Date: Fri, 11 Dec 2009 13:51:55 -0500 Message-ID: In-Reply-To: <1260556842.18299.34.camel@Joe-Laptop.home> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] i2c-iop3xx.c: fix memory resource Thread-Index: Acp6kXLIdGLq4d1ySsW1YMzD+tYFPgAARwgg References: <1260556842.18299.34.camel@Joe-Laptop.home> From: "H Hartley Sweeten" To: "Joe Perches" Cc: "kernel list" , "linux-arm-kernel" , , , "Ben Dooks" , "Lennert Buytenhek" , X-OriginalArrivalTime: 11 Dec 2009 18:51:54.0720 (UTC) FILETIME=[02151E00:01CA7A93] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by alpha.home.local id nBBIqK16002617 Content-Length: 1364 Lines: 35 On Friday, December 11, 2009 11:41 AM, Joe Perches wrote: > On Fri, 2009-12-11 at 13:32 -0500, H Hartley Sweeten wrote: >> The i2c-iop3xx driver requires a resource region of 0x18 bytes and >> currently uses the magic number IOP3XX_I2C_IO_SIZE (defined in >> i2c-iop3xx.h) to indicate this. All of the users of this driver >> have a platform memory resource so use resource_size() instead of >> the magic number. This requires fixing a couple of the memory >> resources since they were either off by 1 or just wrong. >[] >> static struct resource iop13xx_i2c_0_resources[] = { >> [0] = { >> .start = IOP13XX_I2C0_PHYS, >> - .end = IOP13XX_I2C0_PHYS + 0x18, >> + .end = IOP13XX_I2C0_PHYS + 0x17, > > etc. > >> -#define IOP3XX_I2C_IO_SIZE 0x18 > > Maybe it's clearer to keep the IO_SIZE define > and let the compiler do the adding. > > .start = FOO; > .end = FOO + IOP3XX_I2C_IO_SIZE - 1; The problem with that, right now, is that IOP3XX_I2C_IO_SIZE is defined in drivers/i2c/busses/i2c-iop3xx.h. All the platform users under arch/arm would have a pretty oddball include. Also, that header really should just go away and all the information in it just moved into the driver. Regards, Hartley ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?