Commit 1f7a4f9
sunrpc: suppress warnings for unused procfs functions
There is a warning about unused variables when building with W=1 and no procfs:
net/sunrpc/cache.c:1660:30: error: 'cache_flush_proc_ops' defined but not used [-Werror=unused-const-variable=]
1660 | static const struct proc_ops cache_flush_proc_ops = {
| ^~~~~~~~~~~~~~~~~~~~
net/sunrpc/cache.c:1622:30: error: 'content_proc_ops' defined but not used [-Werror=unused-const-variable=]
1622 | static const struct proc_ops content_proc_ops = {
| ^~~~~~~~~~~~~~~~
net/sunrpc/cache.c:1598:30: error: 'cache_channel_proc_ops' defined but not used [-Werror=unused-const-variable=]
1598 | static const struct proc_ops cache_channel_proc_ops = {
| ^~~~~~~~~~~~~~~~~~~~~~
These are used inside of an #ifdef, so replacing that with an
IS_ENABLED() check lets the compiler see how they are used while
still dropping them during dead code elimination.
Fixes: dbf847e ("knfsd: allow cache_register to return error on failure")
Reviewed-by: Jeff Layton <[email protected]>
Acked-by: Chuck Lever <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>1 parent 7a2f6f7 commit 1f7a4f9
1 file changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1674 | 1674 | | |
1675 | 1675 | | |
1676 | 1676 | | |
1677 | | - | |
1678 | 1677 | | |
1679 | 1678 | | |
1680 | 1679 | | |
1681 | 1680 | | |
1682 | 1681 | | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
1683 | 1685 | | |
1684 | 1686 | | |
1685 | 1687 | | |
| |||
1707 | 1709 | | |
1708 | 1710 | | |
1709 | 1711 | | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
1716 | 1712 | | |
1717 | 1713 | | |
1718 | 1714 | | |
| |||
0 commit comments