[RESEND PATCH 1/2] mtd: Add a retlen parameter to _get_{fact, user}_prot_info

Brian Norris computersforpeace at gmail.com
Wed Dec 4 20:38:57 EST 2013


Hi Christian,

Are you sure you compile-tested this? I get build failures. See below.

On Thu, Oct 03, 2013 at 01:14:35PM +0200, Christian Riesch wrote:
> Signed-off-by: Christian Riesch <christian.riesch at omicron.at>
> Cc: Artem Bityutskiy <Artem.Bityutskiy at linux.intel.com>
> ---
>  drivers/mtd/chips/cfi_cmdset_0001.c |   31 +++++++++++++------------------
>  drivers/mtd/devices/mtd_dataflash.c |    7 ++++---
>  drivers/mtd/mtdchar.c               |   11 ++++++-----
>  drivers/mtd/mtdcore.c               |   12 ++++++------
>  drivers/mtd/mtdpart.c               |   14 ++++++++------
>  drivers/mtd/onenand/onenand_base.c  |   30 ++++++++++++------------------
>  include/linux/mtd/mtd.h             |   16 ++++++++--------
>  7 files changed, 57 insertions(+), 64 deletions(-)
> 
> diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
> index 7751443..2378e2f 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0001.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0001.c
> @@ -2399,24 +2399,19 @@ static int cfi_intelext_lock_user_prot_reg(struct mtd_info *mtd,
>  				     NULL, do_otp_lock, 1);
>  }
>  
> -static int cfi_intelext_get_fact_prot_info(struct mtd_info *mtd,
> -					   struct otp_info *buf, size_t len)
> -{
> -	size_t retlen;
> -	int ret;
> +static int cfi_intelext_get_fact_prot_info(struct mtd_info *, size_t,
> +					   size_t *, struct otp_info *);

You have a stray semicolon here, which causes the following compile
errors/warnings:

drivers/mtd/chips/cfi_cmdset_0001.c:2414:1: error: expected identifier or '(' before '{' token
drivers/mtd/chips/cfi_cmdset_0001.c:2411:12: warning: 'cfi_intelext_get_fact_prot_info' declared 'static' but never defined [-Wunused-function]

You seem to have replaced a function definition with just a declaration.

>  

You also have an extraneous blank line.

> -	ret = cfi_intelext_otp_walk(mtd, 0, len, &retlen, (u_char *)buf, NULL, 0);
> -	return ret ? : retlen;
> +{
> +	return cfi_intelext_otp_walk(mtd, 0, len, &retlen, (u_char *)buf,
> +				     NULL, 0);
>  }
>  
...

Brian



More information about the linux-mtd mailing list