Re: [PATCH] staging: ft1000-pcmcia: Fix ft1000_dnld() to work alsoon 64bit architectures.

From: Jiri Slaby
Date: Wed Mar 23 2011 - 06:27:23 EST


On 03/23/2011 08:08 AM, Marek Belisko wrote:
> From: pixo <pixo@pixo-LIFEBOOK-E8310.(none)>
>
> Firmware file needs to be read by 4bytes also on 64 bit architectures.
> Change long type to u32 and also extend checking. Tested on 32 and also
> 64 bit architectures.
>
> Signed-off-by: Stano Lanci <chl.pixo@xxxxxxxxx>
> Signed-off-by: Marek Belisko <marek.belisko@xxxxxxxxxxxxxxx>
>
> Tested-by: Stano Lanci <chl.pixo@xxxxxxxxx>
> ---
> drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c | 78 ++++++++++----------
> 1 files changed, 39 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
> index b0729fc..fb375ea 100644
> --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
> +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
> @@ -95,47 +95,47 @@ void put_request_value(struct net_device *dev, long lvalue);
> USHORT hdr_checksum(PPSEUDO_HDR pHdr);
>
> typedef struct _DSP_FILE_HDR {
> - long build_date;
> - long dsp_coff_date;
> - long loader_code_address;
> - long loader_code_size;
> - long loader_code_end;
> - long dsp_code_address;
> - long dsp_code_size;
> - long dsp_code_end;
> - long reserved[8];
> + u32 build_date;
> + u32 dsp_coff_date;
> + u32 loader_code_address;
> + u32 loader_code_size;
> + u32 loader_code_end;
> + u32 dsp_code_address;
> + u32 dsp_code_size;
> + u32 dsp_code_end;
> + u32 reserved[8];
> } __attribute__ ((packed)) DSP_FILE_HDR, *PDSP_FILE_HDR;

As you also changed signedness, did you check (or do you know) that the
values cannot be negative?

Or at least the change doesn't affect code flow?

regards,
--
js
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/