public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.4] another gcc-3.4 lvalue fix (i2c-proc)
@ 2004-08-19 13:05 O.Sezer
  0 siblings, 0 replies; only message in thread
From: O.Sezer @ 2004-08-19 13:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: marcelo.tosatti

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

Taken from i2c-2.8.x. Please review and apply to 2.4.28.
This hunk was missed in the patch posted at
http://marc.theaimsgroup.com/?l=linux-kernel&m=109182440417014&w=2 .

Ozkan Sezer

[-- Attachment #2: gcc34_i2c-proc.diff --]
[-- Type: text/plain, Size: 915 bytes --]

--- 28p1/drivers/i2c/i2c-proc.c~	2004-02-18 15:36:31.000000000 +0200
+++ 28p1/drivers/i2c/i2c-proc.c	2004-08-19 15:38:29.000000000 +0300
@@ -198,19 +198,19 @@
 
 void i2c_deregister_entry(int id)
 {
-	ctl_table *table;
-	char *temp;
 	id -= 256;
+
 	if (i2c_entries[id]) {
-		table = i2c_entries[id]->ctl_table;
-		unregister_sysctl_table(i2c_entries[id]);
-		/* 2-step kfree needed to keep gcc happy about const points */
-		(const char *) temp = table[4].procname;
-		kfree(temp);
-		kfree(table);
-		i2c_entries[id] = NULL;
-		i2c_clients[id] = NULL;
+		struct ctl_table_header *hdr = i2c_entries[id];
+		struct ctl_table *tbl = hdr->ctl_table;
+
+		unregister_sysctl_table(hdr);
+		kfree(tbl->child->child->procname);
+		kfree(tbl); /* actually the whole anonymous struct */
 	}
+
+	i2c_entries[id] = NULL;
+	i2c_clients[id] = NULL;
 }
 
 /* Monitor access for /proc/sys/dev/sensors; make unloading i2c-proc.o 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-19 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-19 13:05 [PATCH 2.4] another gcc-3.4 lvalue fix (i2c-proc) O.Sezer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox