diff options
author | Peter Foley <pefoley2@pefoley.com> | 2014-09-25 14:23:15 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-09-26 05:02:56 -0400 |
commit | 0421fc837c822e86c76884a30a9155e512a5a66a (patch) | |
tree | dbe95a10a0705f5caf3e7b85bcbed2709f663138 /Documentation | |
parent | adb19fb66eeebac07fe37d968725bb8906dadb8e (diff) |
Documentation: make functions static to avoid prototype warnings
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/arm/SH-Mobile/vrl4.c | 6 | ||||
-rw-r--r-- | Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c | 11 | ||||
-rw-r--r-- | Documentation/prctl/disable-tsc-on-off-stress-test.c | 7 | ||||
-rw-r--r-- | Documentation/prctl/disable-tsc-test.c | 5 |
4 files changed, 16 insertions, 13 deletions
diff --git a/Documentation/arm/SH-Mobile/vrl4.c b/Documentation/arm/SH-Mobile/vrl4.c index e8a191358ad2..4cbbba58f3d2 100644 --- a/Documentation/arm/SH-Mobile/vrl4.c +++ b/Documentation/arm/SH-Mobile/vrl4.c | |||
@@ -77,7 +77,7 @@ struct hdr { | |||
77 | 77 | ||
78 | #define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1)) | 78 | #define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1)) |
79 | 79 | ||
80 | ssize_t do_read(int fd, void *buf, size_t count) | 80 | static ssize_t do_read(int fd, void *buf, size_t count) |
81 | { | 81 | { |
82 | size_t offset = 0; | 82 | size_t offset = 0; |
83 | ssize_t l; | 83 | ssize_t l; |
@@ -98,7 +98,7 @@ ssize_t do_read(int fd, void *buf, size_t count) | |||
98 | return offset; | 98 | return offset; |
99 | } | 99 | } |
100 | 100 | ||
101 | ssize_t do_write(int fd, const void *buf, size_t count) | 101 | static ssize_t do_write(int fd, const void *buf, size_t count) |
102 | { | 102 | { |
103 | size_t offset = 0; | 103 | size_t offset = 0; |
104 | ssize_t l; | 104 | ssize_t l; |
@@ -117,7 +117,7 @@ ssize_t do_write(int fd, const void *buf, size_t count) | |||
117 | return offset; | 117 | return offset; |
118 | } | 118 | } |
119 | 119 | ||
120 | ssize_t write_zero(int fd, size_t len) | 120 | static ssize_t write_zero(int fd, size_t len) |
121 | { | 121 | { |
122 | size_t i = len; | 122 | size_t i = len; |
123 | 123 | ||
diff --git a/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c b/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c index f8e8e95e81fd..81fdd425ab3e 100644 --- a/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c +++ b/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c | |||
@@ -27,19 +27,20 @@ | |||
27 | # define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */ | 27 | # define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */ |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | uint64_t rdtsc() { | 30 | static uint64_t rdtsc(void) |
31 | { | ||
31 | uint32_t lo, hi; | 32 | uint32_t lo, hi; |
32 | /* We cannot use "=A", since this would use %rax on x86_64 */ | 33 | /* We cannot use "=A", since this would use %rax on x86_64 */ |
33 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); | 34 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); |
34 | return (uint64_t)hi << 32 | lo; | 35 | return (uint64_t)hi << 32 | lo; |
35 | } | 36 | } |
36 | 37 | ||
37 | void sigsegv_expect(int sig) | 38 | static void sigsegv_expect(int sig) |
38 | { | 39 | { |
39 | /* */ | 40 | /* */ |
40 | } | 41 | } |
41 | 42 | ||
42 | void segvtask(void) | 43 | static void segvtask(void) |
43 | { | 44 | { |
44 | if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0) | 45 | if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0) |
45 | { | 46 | { |
@@ -54,13 +55,13 @@ void segvtask(void) | |||
54 | } | 55 | } |
55 | 56 | ||
56 | 57 | ||
57 | void sigsegv_fail(int sig) | 58 | static void sigsegv_fail(int sig) |
58 | { | 59 | { |
59 | fprintf(stderr, "FATAL ERROR, rdtsc() failed while enabled\n"); | 60 | fprintf(stderr, "FATAL ERROR, rdtsc() failed while enabled\n"); |
60 | exit(0); | 61 | exit(0); |
61 | } | 62 | } |
62 | 63 | ||
63 | void rdtsctask(void) | 64 | static void rdtsctask(void) |
64 | { | 65 | { |
65 | if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0) | 66 | if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0) |
66 | { | 67 | { |
diff --git a/Documentation/prctl/disable-tsc-on-off-stress-test.c b/Documentation/prctl/disable-tsc-on-off-stress-test.c index 1fcd91445375..4d83a27627f9 100644 --- a/Documentation/prctl/disable-tsc-on-off-stress-test.c +++ b/Documentation/prctl/disable-tsc-on-off-stress-test.c | |||
@@ -29,7 +29,8 @@ | |||
29 | 29 | ||
30 | /* snippet from wikipedia :-) */ | 30 | /* snippet from wikipedia :-) */ |
31 | 31 | ||
32 | uint64_t rdtsc() { | 32 | static uint64_t rdtsc(void) |
33 | { | ||
33 | uint32_t lo, hi; | 34 | uint32_t lo, hi; |
34 | /* We cannot use "=A", since this would use %rax on x86_64 */ | 35 | /* We cannot use "=A", since this would use %rax on x86_64 */ |
35 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); | 36 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); |
@@ -38,7 +39,7 @@ return (uint64_t)hi << 32 | lo; | |||
38 | 39 | ||
39 | int should_segv = 0; | 40 | int should_segv = 0; |
40 | 41 | ||
41 | void sigsegv_cb(int sig) | 42 | static void sigsegv_cb(int sig) |
42 | { | 43 | { |
43 | if (!should_segv) | 44 | if (!should_segv) |
44 | { | 45 | { |
@@ -55,7 +56,7 @@ void sigsegv_cb(int sig) | |||
55 | rdtsc(); | 56 | rdtsc(); |
56 | } | 57 | } |
57 | 58 | ||
58 | void task(void) | 59 | static void task(void) |
59 | { | 60 | { |
60 | signal(SIGSEGV, sigsegv_cb); | 61 | signal(SIGSEGV, sigsegv_cb); |
61 | alarm(10); | 62 | alarm(10); |
diff --git a/Documentation/prctl/disable-tsc-test.c b/Documentation/prctl/disable-tsc-test.c index 843c81eac235..2541e65cb64b 100644 --- a/Documentation/prctl/disable-tsc-test.c +++ b/Documentation/prctl/disable-tsc-test.c | |||
@@ -29,14 +29,15 @@ const char *tsc_names[] = | |||
29 | [PR_TSC_SIGSEGV] = "PR_TSC_SIGSEGV", | 29 | [PR_TSC_SIGSEGV] = "PR_TSC_SIGSEGV", |
30 | }; | 30 | }; |
31 | 31 | ||
32 | uint64_t rdtsc() { | 32 | static uint64_t rdtsc(void) |
33 | { | ||
33 | uint32_t lo, hi; | 34 | uint32_t lo, hi; |
34 | /* We cannot use "=A", since this would use %rax on x86_64 */ | 35 | /* We cannot use "=A", since this would use %rax on x86_64 */ |
35 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); | 36 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); |
36 | return (uint64_t)hi << 32 | lo; | 37 | return (uint64_t)hi << 32 | lo; |
37 | } | 38 | } |
38 | 39 | ||
39 | void sigsegv_cb(int sig) | 40 | static void sigsegv_cb(int sig) |
40 | { | 41 | { |
41 | int tsc_val = 0; | 42 | int tsc_val = 0; |
42 | 43 | ||