Patchwork [U-Boot] ZFS: fix some warnings, cleanup

login
register
mail settings
Submitter Pavel Herrmann
Date Sept. 19, 2012, 3:32 p.m.
Message ID <1348068756-29962-1-git-send-email-morpheus.ibis@gmail.com>
Download mbox | patch
Permalink /patch/185086/
State Changes Requested
Delegated to: Tom Rini
Headers show

Comments

Pavel Herrmann - Sept. 19, 2012, 3:32 p.m.
Fix warnings about type mismatch in cmd_zfs.
Dont use a global block_dev_desc, instead use a local one in each cmd.

Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
---
 common/cmd_zfs.c     | 7 +++++--
 fs/zfs/zfs.c         | 2 --
 include/zfs_common.h | 3 ---
 3 files changed, 5 insertions(+), 7 deletions(-)
Pavel Herrmann - Sept. 23, 2012, 3:31 p.m.
Add some CCs

On Wednesday 19 September 2012 17:32:36 Pavel Herrmann wrote:
> Fix warnings about type mismatch in cmd_zfs.
> Dont use a global block_dev_desc, instead use a local one in each cmd.
> 
> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
> ---
>  common/cmd_zfs.c     | 7 +++++--
>  fs/zfs/zfs.c         | 2 --
>  include/zfs_common.h | 3 ---
>  3 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/common/cmd_zfs.c b/common/cmd_zfs.c
> index a6ea2c0..42e286e 100644
> --- a/common/cmd_zfs.c
> +++ b/common/cmd_zfs.c
> @@ -46,7 +46,8 @@
>  #define DOS_FS_TYPE_OFFSET	0x36
>  #define DOS_FS32_TYPE_OFFSET	0x52
> 
> -static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc,
> +	char * const argv[])
>  {
>  	char *filename = NULL;
>  	char *ep;
> @@ -60,6 +61,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int
> argc, char *argv[]) const char *addr_str;
>  	struct zfs_file zfile;
>  	struct device_s vdev;
> +	struct block_dev_desc *zfs_dev_desc;
> 
>  	if (argc < 3)
>  		return CMD_RET_USAGE;
> @@ -178,7 +180,7 @@ int zfs_print(const char *entry, const struct
> zfs_dirhook_info *data)
> 
> 
> 
> -static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const
> argv[]) {
>  	const char *filename = "/";
>  	int dev;
> @@ -186,6 +188,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int
> argc, char *argv[]) char *ep;
>  	int part_length;
>  	struct device_s vdev;
> +	struct block_dev_desc *zfs_dev_desc;
> 
>  	if (argc < 3)
>  		return cmd_usage(cmdtp);
> diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
> index 360f723..d709e02 100644
> --- a/fs/zfs/zfs.c
> +++ b/fs/zfs/zfs.c
> @@ -31,8 +31,6 @@
>  #include <asm/byteorder.h>
>  #include "zfs_common.h"
> 
> -block_dev_desc_t *zfs_dev_desc;
> -
>  /*
>   * The zfs plug-in routines for GRUB are:
>   *
> diff --git a/include/zfs_common.h b/include/zfs_common.h
> index 04e73d0..fa0919a 100644
> --- a/include/zfs_common.h
> +++ b/include/zfs_common.h
> @@ -66,9 +66,6 @@ struct zfs_filesystem {
>  	block_dev_desc_t *dev_desc;
>  };
> 
> -
> -extern block_dev_desc_t *zfs_dev_desc;
> -
>  struct device_s {
>  	uint64_t part_length;
>  };
Marek Vasut - Sept. 23, 2012, 3:38 p.m.
Dear Pavel Herrmann,

Did you test the changes?

> Add some CCs
> 
> On Wednesday 19 September 2012 17:32:36 Pavel Herrmann wrote:
> > Fix warnings about type mismatch in cmd_zfs.
> > Dont use a global block_dev_desc, instead use a local one in each cmd.

The warnings generated would be appreciated in the commit message.

> > Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
> > ---
> > 
> >  common/cmd_zfs.c     | 7 +++++--
> >  fs/zfs/zfs.c         | 2 --
> >  include/zfs_common.h | 3 ---
> >  3 files changed, 5 insertions(+), 7 deletions(-)
> > 
> > diff --git a/common/cmd_zfs.c b/common/cmd_zfs.c
> > index a6ea2c0..42e286e 100644
> > --- a/common/cmd_zfs.c
> > +++ b/common/cmd_zfs.c
> > @@ -46,7 +46,8 @@
> > 
> >  #define DOS_FS_TYPE_OFFSET	0x36
> >  #define DOS_FS32_TYPE_OFFSET	0x52
> > 
> > -static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char
> > *argv[]) +static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc,
> > +	char * const argv[])
> > 
> >  {
> >  
> >  	char *filename = NULL;
> >  	char *ep;
> > 
> > @@ -60,6 +61,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int
> > argc, char *argv[]) const char *addr_str;
> > 
> >  	struct zfs_file zfile;
> >  	struct device_s vdev;
> > 
> > +	struct block_dev_desc *zfs_dev_desc;
> > 
> >  	if (argc < 3)
> >  	
> >  		return CMD_RET_USAGE;
> > 
> > @@ -178,7 +180,7 @@ int zfs_print(const char *entry, const struct
> > zfs_dirhook_info *data)
> > 
> > 
> > 
> > -static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> > +static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const
> > argv[]) {
> > 
> >  	const char *filename = "/";
> >  	int dev;
> > 
> > @@ -186,6 +188,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int
> > argc, char *argv[]) char *ep;
> > 
> >  	int part_length;
> >  	struct device_s vdev;
> > 
> > +	struct block_dev_desc *zfs_dev_desc;
> > 
> >  	if (argc < 3)
> >  	
> >  		return cmd_usage(cmdtp);
> > 
> > diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
> > index 360f723..d709e02 100644
> > --- a/fs/zfs/zfs.c
> > +++ b/fs/zfs/zfs.c
> > @@ -31,8 +31,6 @@
> > 
> >  #include <asm/byteorder.h>
> >  #include "zfs_common.h"
> > 
> > -block_dev_desc_t *zfs_dev_desc;
> > -
> > 
> >  /*
> >  
> >   * The zfs plug-in routines for GRUB are:
> >   *
> > 
> > diff --git a/include/zfs_common.h b/include/zfs_common.h
> > index 04e73d0..fa0919a 100644
> > --- a/include/zfs_common.h
> > +++ b/include/zfs_common.h
> > @@ -66,9 +66,6 @@ struct zfs_filesystem {
> > 
> >  	block_dev_desc_t *dev_desc;
> >  
> >  };
> > 
> > -
> > -extern block_dev_desc_t *zfs_dev_desc;
> > -
> > 
> >  struct device_s {
> >  
> >  	uint64_t part_length;
> >  
> >  };

Best regards,
Marek Vasut
Tom Rini - Oct. 16, 2012, 12:33 a.m.
On Wed, Sep 19, 2012 at 05:32:36PM +0200, Pavel Herrmann wrote:

> Fix warnings about type mismatch in cmd_zfs.
> Dont use a global block_dev_desc, instead use a local one in each cmd.
> 
> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>

[snip]
> -static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc,
> +	char * const argv[])

That's a checkpatch warning, please fix.

> -static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

Same.
Pavel Herrmann - Oct. 16, 2012, 1:38 p.m.
Hi

On Monday 15 of October 2012 17:33:47 Tom Rini wrote:
> On Wed, Sep 19, 2012 at 05:32:36PM +0200, Pavel Herrmann wrote:
> > Fix warnings about type mismatch in cmd_zfs.
> > Dont use a global block_dev_desc, instead use a local one in each cmd.
> > 
> > Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
> 
> [snip]
> 
> > -static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char
> > *argv[])
> > +static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc,
> > +	char * const argv[])
> 
> That's a checkpatch warning, please fix.
> 
> > -static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> > +static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const
> > argv[])
> Same.

This patch is no longer relevant, as the important bits have been merged in 
next by Rob Herring as a part of the get_device_and_partition patch

Pavel Herrmann

Patch

diff --git a/common/cmd_zfs.c b/common/cmd_zfs.c
index a6ea2c0..42e286e 100644
--- a/common/cmd_zfs.c
+++ b/common/cmd_zfs.c
@@ -46,7 +46,8 @@ 
 #define DOS_FS_TYPE_OFFSET	0x36
 #define DOS_FS32_TYPE_OFFSET	0x52
 
-static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc,
+	char * const argv[])
 {
 	char *filename = NULL;
 	char *ep;
@@ -60,6 +61,7 @@  static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	const char *addr_str;
 	struct zfs_file zfile;
 	struct device_s vdev;
+	struct block_dev_desc *zfs_dev_desc;
 
 	if (argc < 3)
 		return CMD_RET_USAGE;
@@ -178,7 +180,7 @@  int zfs_print(const char *entry, const struct zfs_dirhook_info *data)
 
 
 
-static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	const char *filename = "/";
 	int dev;
@@ -186,6 +188,7 @@  static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	char *ep;
 	int part_length;
 	struct device_s vdev;
+	struct block_dev_desc *zfs_dev_desc;
 
 	if (argc < 3)
 		return cmd_usage(cmdtp);
diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
index 360f723..d709e02 100644
--- a/fs/zfs/zfs.c
+++ b/fs/zfs/zfs.c
@@ -31,8 +31,6 @@ 
 #include <asm/byteorder.h>
 #include "zfs_common.h"
 
-block_dev_desc_t *zfs_dev_desc;
-
 /*
  * The zfs plug-in routines for GRUB are:
  *
diff --git a/include/zfs_common.h b/include/zfs_common.h
index 04e73d0..fa0919a 100644
--- a/include/zfs_common.h
+++ b/include/zfs_common.h
@@ -66,9 +66,6 @@  struct zfs_filesystem {
 	block_dev_desc_t *dev_desc;
 };
 
-
-extern block_dev_desc_t *zfs_dev_desc;
-
 struct device_s {
 	uint64_t part_length;
 };