Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753734AbaJII4c (ORCPT ); Thu, 9 Oct 2014 04:56:32 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]:41409 "EHLO mail-vc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbaJII40 (ORCPT ); Thu, 9 Oct 2014 04:56:26 -0400 MIME-Version: 1.0 In-Reply-To: <1412695544-17251-2-git-send-email-cristian.stoica@freescale.com> References: <1412695544-17251-1-git-send-email-cristian.stoica@freescale.com> <1412695544-17251-2-git-send-email-cristian.stoica@freescale.com> Date: Thu, 9 Oct 2014 10:56:24 +0200 Message-ID: Subject: Re: [PATCH 2/2] uio: support memory sizes larger than 32 bits From: Richard Weinberger To: Cristian Stoica Cc: Greg KH , LKML , "Hans J. Koch" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 7, 2014 at 5:25 PM, Cristian Stoica wrote: > This is a completion to 27a90700a4275c5178b883b65927affdafa5185c > The size field is also increased to allow values larger than 32 bits > on platforms that have more than 32 bit physical addresses. > > Signed-off-by: Cristian Stoica > --- > Documentation/DocBook/uio-howto.tmpl | 2 +- > drivers/uio/uio.c | 2 +- > include/linux/uio_driver.h | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl > index bbe9c1f..1fdc246 100644 > --- a/Documentation/DocBook/uio-howto.tmpl > +++ b/Documentation/DocBook/uio-howto.tmpl > @@ -540,7 +540,7 @@ appears in sysfs. > > > > -unsigned long size: Fill in the size of the > +resource_size_t size: Fill in the size of the > memory block that addr points to. If size > is zero, the mapping is considered unused. Note that you > must initialize size with zero for > diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c > index a673e5b..eaa7347 100644 > --- a/drivers/uio/uio.c > +++ b/drivers/uio/uio.c > @@ -73,7 +73,7 @@ static ssize_t map_addr_show(struct uio_mem *mem, char *buf) > > static ssize_t map_size_show(struct uio_mem *mem, char *buf) > { > - return sprintf(buf, "0x%lx\n", mem->size); > + return sprintf(buf, "0x%llx\n", (unsigned long long)mem->size); We have special printk format strings to handle resource_size_t, please see Documentation/printk-formats.txt. > } > > static ssize_t map_offset_show(struct uio_mem *mem, char *buf) > diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h > index 1ad4724..df6e42e 100644 > --- a/include/linux/uio_driver.h > +++ b/include/linux/uio_driver.h > @@ -35,7 +35,7 @@ struct uio_map; > struct uio_mem { > const char *name; > phys_addr_t addr; > - unsigned long size; > + resource_size_t size; > int memtype; > void __iomem *internal_addr; > struct uio_map *map; > -- > 1.8.3.1 > > -- > 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/ -- Thanks, //richard -- 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/