This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: Silence warnings in flash_am29xxxxx.inl
- From: Gary Thomas <gary at mlbassoc dot com>
- To: sebastien dot couret at elios-informatique dot fr
- Cc: ecos-patches at sources dot redhat dot com
- Date: Fri, 23 Apr 2004 14:52:08 -0600
- Subject: Re: Silence warnings in flash_am29xxxxx.inl
- Organization: MLB Associates
- References: <MELELIOSh8e3U5zjzjP000002ca@melelios.dmz.elios-informatique.fr>
On Wed, 2004-04-21 at 06:11, sebastien Couret wrote:
> Hi guyz,
>
> Some warnings are issued when compiling library with flash_am29xxxxx support
> (AMD Rattler)
^^^
The Rattler is manufactured by Analogue & Micro, Ltd. AMD (a silicon
manufacturer) has nothing to do with it...
>
> "In file included from
> devs/flash/powerpc/rattler/current/src/rattler_flash.c:71:
> include/cyg/io/flash_am29xxxxx.inl: In function `flash_program_buf':
> include/cyg/io/flash_am29xxxxx.inl:434: warning: `SECT' might be used
> uninitialized in this function
> include/cyg/io/flash_am29xxxxx.inl: In function `find_bank':
> include/cyg/io/flash_am29xxxxx.inl:553: warning: return discards qualifiers
> from pointer target type
> include/cyg/io/flash_am29xxxxx.inl: In function `find_sector':
> include/cyg/io/flash_am29xxxxx.inl:573: warning: assignment of read-only
> variable `res'
> "
>
> Here 's a patch to silence these warnings :
>
> diff -a -w -u -r devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl
> devs/flash/amd/am29xxxxx/current/include/1.21/
> --- devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl Wed
> Apr 21 13:02:04 2004
> +++ devs/flash/amd/am29xxxxx/current/include/1.21/flash_am29xxxxx.inl Wed
> Apr 21 13:00:33 2004
> @@ -192,7 +192,7 @@
>
> //---------------------------------------------------------------------------
> -
> // Auxiliary functions
> -volatile flash_data_t * find_bank(volatile flash_data_t * base, void * addr,
> CYG_ADDRWORD * bo)
> +static flash_data_t * find_bank(volatile flash_data_t * base, void * addr,
> CYG_ADDRWORD * bo)
> __attribute__ ((section (".2ram.find_bank")));
> static flash_data_t * find_sector(volatile flash_data_t * addr, unsigned
> long *remain_size)
> __attribute__ ((section (".2ram.find_sector")));
> @@ -431,7 +431,7 @@
> {
> volatile flash_data_t* ROM;
> volatile flash_data_t* BANK;
> - volatile flash_data_t* SECT=NULL;
> + volatile flash_data_t* SECT;
> volatile flash_data_t* data_ptr = (volatile flash_data_t*) data;
> volatile flash_data_t* addr_p = (flash_data_t*) addr;
> volatile flash_data_t* addr_v = FLASH_P2V(addr_p);
> @@ -532,7 +532,7 @@
> return res;
> }
>
> -volatile flash_data_t *
> +static flash_data_t *
> find_bank(volatile flash_data_t * base, void * addr, CYG_ADDRWORD * bo)
> {
> volatile flash_data_t * res = base;
> @@ -559,7 +559,7 @@
> const CYG_ADDRESS mask = flash_dev_info->block_size - 1;
> const CYG_ADDRESS a = (CYG_ADDRESS) addr;
> const CYG_ADDRESS base = a & flash_dev_info->base_mask;
> - CYG_ADDRESS res = a & ~mask;
> + const CYG_ADDRESS res = a & ~mask;
>
> *remain_size = flash_dev_info->block_size - (a & mask);
>
>
>
> And the Changelog entry :
>
> 2004-04-21 Sebastien Couret <sebastien.couret@elios-informatique.com>
>
> * include/flash_am29xxxxx.inl: Silence a few warnings .
>
>
> Have a nice day.
Committed, thanks.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates