Commit cd58310d authored by WANG Cong's avatar WANG Cong Committed by Linus Torvalds

Documentation/spi/spidev_test.c: constify some variables

Constify two char pointers and a struct in Documentation/spi/spidev_test.c.
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 328329a7
...@@ -29,7 +29,7 @@ static void pabort(const char *s) ...@@ -29,7 +29,7 @@ static void pabort(const char *s)
abort(); abort();
} }
static char *device = "/dev/spidev1.1"; static const char *device = "/dev/spidev1.1";
static uint8_t mode; static uint8_t mode;
static uint8_t bits = 8; static uint8_t bits = 8;
static uint32_t speed = 500000; static uint32_t speed = 500000;
...@@ -69,7 +69,7 @@ static void transfer(int fd) ...@@ -69,7 +69,7 @@ static void transfer(int fd)
puts(""); puts("");
} }
void print_usage(char *prog) void print_usage(const char *prog)
{ {
printf("Usage: %s [-DsbdlHOLC3]\n", prog); printf("Usage: %s [-DsbdlHOLC3]\n", prog);
puts(" -D --device device to use (default /dev/spidev1.1)\n" puts(" -D --device device to use (default /dev/spidev1.1)\n"
...@@ -88,7 +88,7 @@ void print_usage(char *prog) ...@@ -88,7 +88,7 @@ void print_usage(char *prog)
void parse_opts(int argc, char *argv[]) void parse_opts(int argc, char *argv[])
{ {
while (1) { while (1) {
static struct option lopts[] = { static const struct option lopts[] = {
{ "device", 1, 0, 'D' }, { "device", 1, 0, 'D' },
{ "speed", 1, 0, 's' }, { "speed", 1, 0, 's' },
{ "delay", 1, 0, 'd' }, { "delay", 1, 0, 'd' },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment