Skip to contentSkip to conversation

Documentation/spi/spidev_test.c: constify some variables

PATCH In review WANG Cong 2 participants 2 messages Oct 6, 2007 SPI

lore
Share & tools
lore

WANG Cong

author
#0 lore raw

PATCH 1/1 Documentation/spi/spidev_test.c: constify some variables

Constify two char pointers and a struct in Documentation/spi/spidev_test.c.

CC David Brownell <[email protected]>
CC Anton Vorontsov <[email protected]>
---
 Documentation/spi/spidev_test.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/spi/spidev_test.c +3 -3
Index: linux-2.6.23-rc9/Documentation/spi/spidev_test.c
===================================================================
@@ -29,7 +29,7 @@ static void pabort(const char *s)
 	abort();
 }
 
-static char *device = "/dev/spidev1.1";
+static const char *device = "/dev/spidev1.1";
 static uint8_t mode;
 static uint8_t bits = 8;
 static uint32_t speed = 500000;
@@ -69,7 +69,7 @@ static void transfer(int fd)
 	puts("");
 }
 
-void print_usage(char *prog)
+void print_usage(const char *prog)
 {
 	printf("Usage: %s [-DsbdlHOLC3]\n", prog);
 	puts("  -D --device   device to use (default /dev/spidev1.1)\n"
@@ -88,7 +88,7 @@ void print_usage(char *prog)
 void parse_opts(int argc, char *argv[])
 {
 	while (1) {
-		static struct option lopts[] = {
+		static const struct option lopts[] = {
 			{ "device",  1, 0, 'D' },
 			{ "speed",   1, 0, 's' },
 			{ "delay",   1, 0, 'd' },

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#1 lore raw
Quoted 5 lines

From: WANG Cong <[email protected]>

Constify two char pointers and a struct in Documentation/spi/spidev_test.c.

CC David Brownell <[email protected]>

ACK

Quoted 3 lines
CC Anton Vorontsov <[email protected]>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/