netdev
[Top] [All Lists]

[PATCH] sb1000: reduce ioctl stack usage

To: jgarzik <jgarzik@xxxxxxxxx>, netdev <netdev@xxxxxxxxxxx>, fventuri@xxxxxxxxxxxx, shirsch@xxxxxxxxxxxx
Subject: [PATCH] sb1000: reduce ioctl stack usage
From: "Randy.Dunlap" <rddunlap@xxxxxxxx>
Date: Sun, 30 Jan 2005 18:12:00 -0800
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

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@xxxxxxxx>

diffstat:=
 drivers/net/sb1000.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
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];
<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] sb1000: reduce ioctl stack usage, Randy.Dunlap <=