netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: jgarzik <jgarzik@pobox.com>, netdev <netdev@oss.sgi.com>,
	fventuri@mediaone.net, shirsch@adelphia.net
Subject: [PATCH] sb1000: reduce ioctl stack usage
Date: Sun, 30 Jan 2005 18:12:00 -0800	[thread overview]
Message-ID: <41FD93F0.2040601@osdl.org> (raw)

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


sb1000_dev_ioctl() (on i386) uses 824 bytes of stack space,
all due to overuse of inline functions.
By changing a few infrequently used functions to non-inline,
the stack usage is reduced to only 60 bytes.
Nothing in a fast path is changed.

Signed-off-by: Randy Dunlap <rddunlap@osdl.org>

diffstat:=
  drivers/net/sb1000.c |   20 ++++++++++----------
  1 files changed, 10 insertions(+), 10 deletions(-)

[-- Attachment #2: sb1000_stack.patch --]
[-- Type: text/x-patch, Size: 2447 bytes --]


diff -Naurp ./drivers/net/sb1000.c~sb1000_stack ./drivers/net/sb1000.c
--- ./drivers/net/sb1000.c~sb1000_stack	2004-12-24 13:33:51.000000000 -0800
+++ ./drivers/net/sb1000.c	2005-01-30 17:49:27.409413904 -0800
@@ -116,15 +116,15 @@ static inline int sb1000_start_get_set_c
 static inline int sb1000_end_get_set_command(const int ioaddr[],
 	const char* name);
 static inline int sb1000_activate(const int ioaddr[], const char* name);
-static inline int sb1000_get_firmware_version(const int ioaddr[],
+static int sb1000_get_firmware_version(const int ioaddr[],
 	const char* name, unsigned char version[], int do_end);
-static inline int sb1000_get_frequency(const int ioaddr[], const char* name,
+static int sb1000_get_frequency(const int ioaddr[], const char* name,
 	int* frequency);
-static inline int sb1000_set_frequency(const int ioaddr[], const char* name,
+static int sb1000_set_frequency(const int ioaddr[], const char* name,
 	int frequency);
-static inline int sb1000_get_PIDs(const int ioaddr[], const char* name,
+static int sb1000_get_PIDs(const int ioaddr[], const char* name,
 	short PID[]);
-static inline int sb1000_set_PIDs(const int ioaddr[], const char* name,
+static int sb1000_set_PIDs(const int ioaddr[], const char* name,
 	const short PID[]);
 
 /* SB1000 commands for frame rx interrupt */
@@ -552,7 +552,7 @@ sb1000_activate(const int ioaddr[], cons
 }
 
 /* get SB1000 firmware version */
-static inline int
+static int
 sb1000_get_firmware_version(const int ioaddr[], const char* name,
 	unsigned char version[], int do_end)
 {
@@ -575,7 +575,7 @@ sb1000_get_firmware_version(const int io
 }
 
 /* get SB1000 frequency */
-static inline int
+static int
 sb1000_get_frequency(const int ioaddr[], const char* name, int* frequency)
 {
 	unsigned char st[7];
@@ -592,7 +592,7 @@ sb1000_get_frequency(const int ioaddr[],
 }
 
 /* set SB1000 frequency */
-static inline int
+static int
 sb1000_set_frequency(const int ioaddr[], const char* name, int frequency)
 {
 	unsigned char st[7];
@@ -622,7 +622,7 @@ sb1000_set_frequency(const int ioaddr[],
 }
 
 /* get SB1000 PIDs */
-static inline int
+static int
 sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[])
 {
 	unsigned char st[7];
@@ -656,7 +656,7 @@ sb1000_get_PIDs(const int ioaddr[], cons
 }
 
 /* set SB1000 PIDs */
-static inline int
+static int
 sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[])
 {
 	unsigned char st[7];

                 reply	other threads:[~2005-01-31  2:12 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=41FD93F0.2040601@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=fventuri@mediaone.net \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=shirsch@adelphia.net \
    /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;
as well as URLs for NNTP newsgroup(s).