Commit f4bf6ab7 authored by Pietro Fezzardi's avatar Pietro Fezzardi Committed by Alessandro Rubini

new return type for get_persistent_mac and set_persistent_mac

Some declaration was int8_t, some int32_t and some didn't match
the function definition. Now everything returns just int.
Anyway the functions return only 0 or -1, so there are no problems
returning int. Moreover in this way the resulting assembler is
smaller for every target architecture (even if here we always
build for lm32)

This reduces the binary by 30 bytes.
parent 2d17de26
......@@ -370,13 +370,13 @@ int8_t eeprom_init_readcmd(uint8_t i2cif, uint8_t i2c_addr, uint8_t *buf,
* have i2c eeprom and never saved a persistent mac address. But maybe
* they prefer w1 for temperature (well, sockitowm will go)
*/
int8_t set_persistent_mac(uint8_t portnum, uint8_t * mac)
int set_persistent_mac(uint8_t portnum, uint8_t * mac)
{
pp_printf("Can't save persistent MAC address\n");
return -1;
}
int32_t get_persistent_mac(uint8_t portnum, uint8_t * mac)
int get_persistent_mac(uint8_t portnum, uint8_t * mac)
{
int i, class;
uint64_t rom;
......
......@@ -117,7 +117,7 @@ uint8_t eeprom_present(uint8_t i2cif, uint8_t i2c_addr)
* setting if no sdbfs is there, but CONFIG_SDB_EEPROM depends on
* CONFIG_W1 anyways.
*/
int32_t get_persistent_mac(uint8_t portnum, uint8_t * mac)
int get_persistent_mac(uint8_t portnum, uint8_t * mac)
{
int ret;
int i, class;
......@@ -156,7 +156,7 @@ int32_t get_persistent_mac(uint8_t portnum, uint8_t * mac)
return 0;
}
int8_t set_persistent_mac(uint8_t portnum, uint8_t * mac)
int set_persistent_mac(uint8_t portnum, uint8_t * mac)
{
int ret;
......
......@@ -10,7 +10,7 @@
void own_scanbus(uint8_t portnum);
int16_t own_readtemp(uint8_t portnum, int16_t * temp, int16_t * t_frac);
/* 0 = success, -1 = error */
int8_t get_persistent_mac(uint8_t portnum, uint8_t * mac);
int8_t set_persistent_mac(uint8_t portnum, uint8_t * mac);
int get_persistent_mac(uint8_t portnum, uint8_t * mac);
int set_persistent_mac(uint8_t portnum, uint8_t * mac);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment