[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0806020921590.7351@anakin>
Date: Mon, 2 Jun 2008 09:22:10 +0200 (CEST)
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: akinobu.mita@...il.com
cc: linux-kernel@...r.kernel.org
Subject: Re: [patch -v2 19/23] zorro: use memory_read_from_buffer
On Mon, 2 Jun 2008, akinobu.mita@...il.com wrote:
> Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
> Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> ---
> drivers/zorro/zorro-sysfs.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> Index: 2.6-git/drivers/zorro/zorro-sysfs.c
> ===================================================================
> --- 2.6-git.orig/drivers/zorro/zorro-sysfs.c
> +++ 2.6-git/drivers/zorro/zorro-sysfs.c
> @@ -15,6 +15,7 @@
> #include <linux/zorro.h>
> #include <linux/stat.h>
> #include <linux/string.h>
> +#include <linux/fs.h>
>
> #include "zorro.h"
>
> @@ -56,12 +57,6 @@ static ssize_t zorro_read_config(struct
> struct zorro_dev *z = to_zorro_dev(container_of(kobj, struct device,
> kobj));
> struct ConfigDev cd;
> - unsigned int size = sizeof(cd);
> -
> - if (off > size)
> - return 0;
> - if (off+count > size)
> - count = size-off;
>
> /* Construct a ConfigDev */
> memset(&cd, 0, sizeof(cd));
> @@ -71,8 +66,7 @@ static ssize_t zorro_read_config(struct
> cd.cd_BoardAddr = (void *)zorro_resource_start(z);
> cd.cd_BoardSize = zorro_resource_len(z);
>
> - memcpy(buf, (void *)&cd+off, count);
> - return count;
> + return memory_read_from_buffer(buf, count, &off, &cd, sizeof(cd));
> }
>
> static struct bin_attribute zorro_config_attr = {
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists