[PATCH 1/3] Staging: comedi: serial2002: decrease stack usage

Ian Abbott abbotti at mev.co.uk
Fri Nov 20 11:32:36 UTC 2009


512 bytes of stack can be saved in serial_2002_open() by modifying
'struct config_t'.  A short int suffices for the 'kind' and 'bits'
members.  (Actually, a char would suffice, but wouldn't save any more
stack than a short int.)

Signed-off-by: Ian Abbott <abbotti at mev.co.uk>
---
 drivers/staging/comedi/drivers/serial2002.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
index 82aa86e..418ea06 100644
--- a/drivers/staging/comedi/drivers/serial2002.c
+++ b/drivers/staging/comedi/drivers/serial2002.c
@@ -409,8 +409,8 @@ static void serial_2002_open(struct comedi_device *dev)
 	} else {
 		struct config_t {
 
-			int kind;
-			int bits;
+			short int kind;
+			short int bits;
 			int min;
 			int max;
 		};
-- 
1.6.5.3




More information about the devel mailing list