summarylogtreecommitdiffstats
path: root/0030-Linux-Define-afs_thread_wrapper-as-static.patch
blob: 9dce78058f0576b0952100cbb0a53e62233da4f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From dfb6b53a6802e90f6bc2cd3cd39da467ce8e4488 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed, 3 Apr 2024 11:36:54 -0600
Subject: [PATCH 30/32] Linux: Define afs_thread_wrapper() as static

When building against a Linux 6.8 kernel, functions that are missing
prototypes or declarations are flagged.

We can add the static attribute to functions that are not referenced
outside of the file that implements them to avoid having these functions
flagged by the compiler.

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

This is an openafs-1.8.x specific commit.

The function afs_thread_wrapper() in LINUX/osi_misc.c on the master
branch was changed to a static function with commit:
 'afs: Drop GLOCK for various Rx calls' (d5e1428a3b)
However this is a larger change than needed to fix the build problem and
the commit could have a significant impact for 1.8.x since it is
changing rx locking.  To avoid introducing such a change, just change
the afs_thread_wrapper() to static as a 1.8.x specific commit.

There are no functional changes in this commit.

Change-Id: I4edc61e6a4989c16ccf41b935e205dbf209bf2a5
Reviewed-on: https://gerrit.openafs.org/15727
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
---
 src/afs/LINUX/osi_misc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c
index aa5d5fc93..27f73cd1f 100644
--- a/src/afs/LINUX/osi_misc.c
+++ b/src/afs/LINUX/osi_misc.c
@@ -155,7 +155,8 @@ int osi_abspath(char *aname, char *buf, int buflen,
 
 
 /* This could use some work, and support on more platforms. */
-int afs_thread_wrapper(void *rock)
+static int
+afs_thread_wrapper(void *rock)
 {
     void (*proc)(void) = rock;
     __module_get(THIS_MODULE);
-- 
2.45.1