public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "O.Sezer" <sezeroz@ttnet.net.tr>
To: linux-kernel@vger.kernel.org
Cc: marcelo.tosatti@cyclades.com
Subject: [PATCH 2.4] another gcc-3.4 lvalue fix (i2c-proc)
Date: Thu, 19 Aug 2004 16:05:06 +0300	[thread overview]
Message-ID: <4124A582.4060300@ttnet.net.tr> (raw)

[-- 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 

                 reply	other threads:[~2004-08-19 13:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4124A582.4060300@ttnet.net.tr \
    --to=sezeroz@ttnet.net.tr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox