From d78cd0cb5f5aae5d19654eeac128103071db2a40 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Tue, 16 Feb 1999 21:59:05 +0000 Subject: [PATCH] Removed some compiler warnings All our own code (ie. anything not in the i2c directory) compiles now without warnings, even with WARN=1 (which sets -Wall -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wnested-externs -Winline). There is one exception: the lex code (conf-lex.l) complains about unused functions. That's flex' fault, not ours! The i2c code still emits many warnings with the above flags; that's Simon's problem. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@233 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-ali15x3.c | 4 ++-- kernel/busses/i2c-via.c | 2 +- kernel/chips/eeprom.c | 17 ++++++----------- kernel/chips/ltc1710.c | 1 - kernel/chips/sis5595.c | 2 +- kernel/sensors.c | 5 ++++- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/kernel/busses/i2c-ali15x3.c b/kernel/busses/i2c-ali15x3.c index 4114aece..2b2f6d8d 100644 --- a/kernel/busses/i2c-ali15x3.c +++ b/kernel/busses/i2c-ali15x3.c @@ -251,7 +251,7 @@ int ali15x3_setup(void) #ifdef MAP_ACPI if (check_region(ali15x3_acpia, ALI15X3_ACPI_IOSIZE)) { printk("ali15x3.o: ALI15X3_acpi region 0x%x already in use!\n", ali15x3_acpia); - printk("ali15x3.o: If conflicting ACPI software is installed, undefine MAP_ACPI and recompile!\n", ali15x3_acpia); + printk("ali15x3.o: If conflicting ACPI software is installed, undefine MAP_ACPI and recompile!\n"); error_return=-ENODEV; } #endif @@ -380,7 +380,7 @@ int ali15x3_transaction(void) then the BUSY bit may come back on when you try and use the chip again. If that's the case you are stuck. */ - printk("ali15x3.o: Resetting entire SMB Bus to clear busy condition\n",temp); + printk("ali15x3.o: Resetting entire SMB Bus to clear busy condition (%02x)\n",temp); outb_p(ALI15X3_T_OUT, SMBHSTCNT); temp = inb_p(SMBHSTSTS); } diff --git a/kernel/busses/i2c-via.c b/kernel/busses/i2c-via.c index b4525273..1deacace 100644 --- a/kernel/busses/i2c-via.c +++ b/kernel/busses/i2c-via.c @@ -199,7 +199,7 @@ static int find_via(void) } #endif -int init_i2c_via() +int init_i2c_via(void) { if (find_via() < 0) { printk("Error while reading PCI configuration\n"); diff --git a/kernel/chips/eeprom.c b/kernel/chips/eeprom.c index 09a30c86..51c6f359 100644 --- a/kernel/chips/eeprom.c +++ b/kernel/chips/eeprom.c @@ -67,10 +67,9 @@ static int eeprom_command(struct i2c_client *client, unsigned int cmd, static void eeprom_inc_use (struct i2c_client *client); static void eeprom_dec_use (struct i2c_client *client); -static u16 swap_bytes(u16 val); - -static int eeprom_read_value(struct i2c_client *client, u8 reg); +#if 0 static int eeprom_write_value(struct i2c_client *client, u8 reg, u16 value); +#endif static void eeprom_contents(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results); @@ -252,22 +251,18 @@ void eeprom_dec_use (struct i2c_client *client) #endif } -u16 swap_bytes(u16 val) -{ - return (val >> 8) | (val << 8); -} - -/* No swapping needed here! */ +#if 0 +/* No writes yet (PAE) */ int eeprom_write_value(struct i2c_client *client, u8 reg, u16 value) -{/* +{ if (reg == EEPROM_REG_CONF) return smbus_write_byte_data(client->adapter,client->addr,reg,value); else return smbus_write_word_data(client->adapter,client->addr,reg,value); */ - /* No writes yet (PAE) */ return 0; } +#endif void eeprom_update_client(struct i2c_client *client) { diff --git a/kernel/chips/ltc1710.c b/kernel/chips/ltc1710.c index 446c7b38..8991206a 100644 --- a/kernel/chips/ltc1710.c +++ b/kernel/chips/ltc1710.c @@ -80,7 +80,6 @@ static int ltc1710_command(struct i2c_client *client, unsigned int cmd, void *arg); static void ltc1710_inc_use (struct i2c_client *client); static void ltc1710_dec_use (struct i2c_client *client); -static u16 swap_bytes(u16 val); static void ltc1710_switch1(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results); static void ltc1710_switch2(struct i2c_client *client, int operation, int ctl_name, diff --git a/kernel/chips/sis5595.c b/kernel/chips/sis5595.c index c5591510..83b8807e 100644 --- a/kernel/chips/sis5595.c +++ b/kernel/chips/sis5595.c @@ -346,7 +346,7 @@ int lm78_detect_isa(struct isa_adapter *adapter) /* OK, this is detection. */ - if (err=find_sis(&address)) { + if ((err=find_sis(&address))) { printk("SiS 5595 southbridge not found\n"); return err; } diff --git a/kernel/sensors.c b/kernel/sensors.c index 189e5027..c52e9e9c 100644 --- a/kernel/sensors.c +++ b/kernel/sensors.c @@ -191,11 +191,14 @@ int sensors_register_entry(struct i2c_client *client ,const char *prefix, void sensors_deregister_entry(int id) { ctl_table *table; + char *temp; id -= 256; if (sensors_entries[id]) { table = sensors_entries[id]->ctl_table; unregister_sysctl_table(sensors_entries[id]); - kfree((void *) (table[4].procname)); + /* Below two-step kfree is needed to keep gcc happy about const points */ + (const char *) temp = table[4].procname; + kfree(temp); kfree(table); sensors_entries[id] = NULL; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))