aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@pefoley.com>2014-09-25 14:23:15 -0400
committerJiri Kosina <jkosina@suse.cz>2014-09-26 05:02:56 -0400
commit0421fc837c822e86c76884a30a9155e512a5a66a (patch)
treedbe95a10a0705f5caf3e7b85bcbed2709f663138 /Documentation
parentadb19fb66eeebac07fe37d968725bb8906dadb8e (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.c6
-rw-r--r--Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c11
-rw-r--r--Documentation/prctl/disable-tsc-on-off-stress-test.c7
-rw-r--r--Documentation/prctl/disable-tsc-test.c5
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
80ssize_t do_read(int fd, void *buf, size_t count) 80static 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
101ssize_t do_write(int fd, const void *buf, size_t count) 101static 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
120ssize_t write_zero(int fd, size_t len) 120static 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
30uint64_t rdtsc() { 30static uint64_t rdtsc(void)
31{
31uint32_t lo, hi; 32uint32_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));
34return (uint64_t)hi << 32 | lo; 35return (uint64_t)hi << 32 | lo;
35} 36}
36 37
37void sigsegv_expect(int sig) 38static void sigsegv_expect(int sig)
38{ 39{
39 /* */ 40 /* */
40} 41}
41 42
42void segvtask(void) 43static 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
57void sigsegv_fail(int sig) 58static 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
63void rdtsctask(void) 64static 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
32uint64_t rdtsc() { 32static uint64_t rdtsc(void)
33{
33uint32_t lo, hi; 34uint32_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
39int should_segv = 0; 40int should_segv = 0;
40 41
41void sigsegv_cb(int sig) 42static 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
58void task(void) 59static 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
32uint64_t rdtsc() { 32static uint64_t rdtsc(void)
33{
33uint32_t lo, hi; 34uint32_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));
36return (uint64_t)hi << 32 | lo; 37return (uint64_t)hi << 32 | lo;
37} 38}
38 39
39void sigsegv_cb(int sig) 40static void sigsegv_cb(int sig)
40{ 41{
41 int tsc_val = 0; 42 int tsc_val = 0;
42 43