From: =?unknown-8bit?Q?J=F6rn?= Engel <joern@wohnheim.fh-wedel.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 2.5.64: i2c-proc kills machine at boot
Date: Wed, 12 Mar 2003 17:14:52 +0100 [thread overview]
Message-ID: <20030312161451.GA30741@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <1047484999.22696.7.camel@irongate.swansea.linux.org.uk>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 6845 bytes --]
On Wed, 12 March 2003 16:03:19 +0000, Alan Cox wrote:
>
> > It also isn't listed in the current MAINTAINERS file. Is i2o currently
> > unmaintained?
>
> Its kind of mine. Maintained is an overly strong word for it however, but I
> do take patches 8)
All right. The following is against 2.5.64, compiles and reduces the
worst stack offender to 0x190 bytes. It is untested though, I don't
have any hardware for it.
Jörn
--
"Translations are and will always be problematic. They inflict violence
upon two languages." (translation from German)
--- linux-2.5.64/drivers/message/i2o/i2o_proc.c Mon Feb 24 20:05:35 2003
+++ linux-2.5.64-i2o/drivers/message/i2o/i2o_proc.c Wed Mar 12 17:09:26 2003
@@ -836,29 +836,33 @@
u16 row_count;
u16 more_flag;
i2o_exec_execute_ddm_table ddm_table[MAX_I2O_MODULES];
- } result;
+ } *result;
i2o_exec_execute_ddm_table ddm_table;
spin_lock(&i2o_proc_lock);
len = 0;
+ result = kmalloc(sizeof(*result), GFP_KERNEL);
+ if(!result)
+ return -ENOMEM;
+
token = i2o_query_table(I2O_PARAMS_TABLE_GET,
c, ADAPTER_TID,
0x0003, -1,
NULL, 0,
- &result, sizeof(result));
+ result, sizeof(*result));
if (token < 0) {
len += i2o_report_query_status(buf+len, token,"0x0003 Executing DDM List");
spin_unlock(&i2o_proc_lock);
- return len;
+ goto out;
}
len += sprintf(buf+len, "Tid Module_type Vendor Mod_id Module_name Vrs Data_size Code_size\n");
- ddm_table=result.ddm_table[0];
+ ddm_table=result->ddm_table[0];
- for(i=0; i < result.row_count; ddm_table=result.ddm_table[++i])
+ for(i=0; i < result->row_count; ddm_table=result->ddm_table[++i])
{
len += sprintf(buf+len, "0x%03x ", ddm_table.ddm_tid & 0xFFF);
@@ -884,7 +888,8 @@
}
spin_unlock(&i2o_proc_lock);
-
+out:
+ kfree(result);
return len;
}
@@ -1047,32 +1052,36 @@
u16 row_count;
u16 more_flag;
i2o_group_info group[256];
- } result;
+ } *result;
spin_lock(&i2o_proc_lock);
+ result = kmalloc(sizeof(*result), GFP_KERNEL);
+ if(!result)
+ return -ENOMEM;
+
len = 0;
token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid, 0xF000, -1, NULL, 0,
- &result, sizeof(result));
+ result, sizeof(*result));
if (token < 0) {
len = i2o_report_query_status(buf+len, token, "0xF000 Params Descriptor");
spin_unlock(&i2o_proc_lock);
- return len;
+ goto out;
}
len += sprintf(buf+len, "# Group FieldCount RowCount Type Add Del Clear\n");
- for (i=0; i < result.row_count; i++)
+ for (i=0; i < result->row_count; i++)
{
len += sprintf(buf+len, "%-3d", i);
- len += sprintf(buf+len, "0x%04X ", result.group[i].group_number);
- len += sprintf(buf+len, "%10d ", result.group[i].field_count);
- len += sprintf(buf+len, "%8d ", result.group[i].row_count);
+ len += sprintf(buf+len, "0x%04X ", result->group[i].group_number);
+ len += sprintf(buf+len, "%10d ", result->group[i].field_count);
+ len += sprintf(buf+len, "%8d ", result->group[i].row_count);
- properties = result.group[i].properties;
+ properties = result->group[i].properties;
if (properties & 0x1) len += sprintf(buf+len, "Table ");
else len += sprintf(buf+len, "Scalar ");
if (properties & 0x2) len += sprintf(buf+len, " + ");
@@ -1085,11 +1094,12 @@
len += sprintf(buf+len, "\n");
}
- if (result.more_flag)
+ if (result->more_flag)
len += sprintf(buf+len, "There is more...\n");
spin_unlock(&i2o_proc_lock);
-
+out:
+ kfree(result);
return len;
}
@@ -1220,36 +1230,42 @@
u16 row_count;
u16 more_flag;
i2o_user_table user[64];
- } result;
+ } *result;
spin_lock(&i2o_proc_lock);
len = 0;
+ result = kmalloc(sizeof(*result), GFP_KERNEL);
+ if(!result)
+ return -ENOMEM;
+
token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid,
0xF003, -1, NULL, 0,
- &result, sizeof(result));
+ result, sizeof(*result));
if (token < 0) {
len += i2o_report_query_status(buf+len, token,"0xF003 User Table");
spin_unlock(&i2o_proc_lock);
- return len;
+ goto out;
}
len += sprintf(buf+len, "# Instance UserTid ClaimType\n");
- for(i=0; i < result.row_count; i++)
+ for(i=0; i < result->row_count; i++)
{
len += sprintf(buf+len, "%-3d", i);
- len += sprintf(buf+len, "%#8x ", result.user[i].instance);
- len += sprintf(buf+len, "%#7x ", result.user[i].user_tid);
- len += sprintf(buf+len, "%#9x\n", result.user[i].claim_type);
+ len += sprintf(buf+len, "%#8x ", result->user[i].instance);
+ len += sprintf(buf+len, "%#7x ", result->user[i].user_tid);
+ len += sprintf(buf+len, "%#9x\n", result->user[i].claim_type);
}
- if (result.more_flag)
+ if (result->more_flag)
len += sprintf(buf+len, "There is more...\n");
spin_unlock(&i2o_proc_lock);
+out:
+ kfree(result);
return len;
}
@@ -2264,24 +2280,28 @@
u16 row_count;
u16 more_flag;
u8 mc_addr[256][8];
- } result;
+ } *result;
spin_lock(&i2o_proc_lock);
len = 0;
+ result = kmalloc(sizeof(*result), GFP_KERNEL);
+ if(!result)
+ return -ENOMEM;
+
token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid, 0x0002, -1,
- NULL, 0, &result, sizeof(result));
+ NULL, 0, result, sizeof(*result));
if (token < 0) {
len += i2o_report_query_status(buf+len, token,"0x002 LAN Multicast MAC Address");
spin_unlock(&i2o_proc_lock);
- return len;
+ goto out;
}
- for (i = 0; i < result.row_count; i++)
+ for (i = 0; i < result->row_count; i++)
{
- memcpy(mc_addr, result.mc_addr[i], 8);
+ memcpy(mc_addr, result->mc_addr[i], 8);
len += sprintf(buf+len, "MC MAC address[%d]: "
"%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
@@ -2291,6 +2311,8 @@
}
spin_unlock(&i2o_proc_lock);
+out:
+ kfree(result);
return len;
}
@@ -2495,24 +2517,28 @@
u16 row_count;
u16 more_flag;
u8 alt_addr[256][8];
- } result;
+ } *result;
spin_lock(&i2o_proc_lock);
len = 0;
+ result = kmalloc(sizeof(*result), GFP_KERNEL);
+ if(!result)
+ return -ENOMEM;
+
token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid,
- 0x0006, -1, NULL, 0, &result, sizeof(result));
+ 0x0006, -1, NULL, 0, result, sizeof(*result));
if (token < 0) {
len += i2o_report_query_status(buf+len, token, "0x0006 LAN Alternate Address (optional)");
spin_unlock(&i2o_proc_lock);
- return len;
+ goto out;
}
- for (i=0; i < result.row_count; i++)
+ for (i=0; i < result->row_count; i++)
{
- memcpy(alt_addr,result.alt_addr[i],8);
+ memcpy(alt_addr,result->alt_addr[i],8);
len += sprintf(buf+len, "Alternate address[%d]: "
"%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
i, alt_addr[0], alt_addr[1], alt_addr[2],
@@ -2521,6 +2547,8 @@
}
spin_unlock(&i2o_proc_lock);
+out:
+ kfree(result);
return len;
}
next prev parent reply other threads:[~2003-03-12 16:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-11 10:47 Pavel Machek
2003-03-12 12:56 ` =?unknown-8bit?Q?J=F6rn?= Engel
2003-03-12 13:31 ` Vojtech Pavlik
2003-03-12 13:38 ` =?unknown-8bit?Q?J=F6rn?= Engel
2003-03-12 16:03 ` Alan Cox
2003-03-12 16:14 ` =?unknown-8bit?Q?J=F6rn?= Engel [this message]
[not found] ` <20030312110650.7c4b8571.akpm@digeo.com>
2003-03-12 19:22 ` Joern Engel
2003-03-12 21:55 ` Alan Cox
2003-03-12 15:00 ` Christoph Hellwig
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=20030312161451.GA30741@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®