Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/include/vega10_ip_offset: Mark _BASE structs as __maybe_unused

This patch fixes nearly 400 warnings!

These structures are too widely used in too many varying
configurations to be split-up into different headers or moved into
source files.

Instead, we'll mark them as __maybe_unused which tells the compiler
that we're aware they're being included into source files which do not
make use of them - but we've looked into it, and it's okay.

Let's tidy-up whilst were here. Just alignment stuff.

Fixes the following W=1 kernel build warning(s):

In file included from drivers/gpu/drm/amd/amdgpu/navi14_reg_init.c:27:
drivers/gpu/drm/amd/amdgpu/../include/navi14_ip_offset.h:179:29: warning: ‘USB0_BASE’ defined but not used [-Wunused-const-variable=]
179 | static const struct IP_BASE USB0_BASE ={ { { { 0x0242A800, 0x05B00000, 0, 0, 0 } },
| ^~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../include/navi14_ip_offset.h:172:29: warning: ‘UMC_BASE’ defined but not used [-Wunused-const-variable=]
172 | static const struct IP_BASE UMC_BASE ={ { { { 0x00014000, 0x02425800, 0, 0, 0 } },
| ^~~~~~~~
drivers/gpu/drm/amd/amdgpu/../include/navi14_ip_offset.h:151:29: warning: ‘SDMA_BASE’ defined but not used [-Wunused-const-variable=]
151 | static const struct IP_BASE SDMA_BASE ={ { { { 0x00001260, 0x0000A000, 0x02402C00, 0, 0 } },
| ^~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../include/navi14_ip_offset.h:144:29: warning: ‘PCIE0_BASE’ defined but not used [-Wunused-const-variable=]
144 | static const struct IP_BASE PCIE0_BASE ={ { { { 0x00000000, 0x00000014, 0x00000D20, 0x00010400, 0x0241B000 } },
| ^~~~~~~~~~

NB: Snipped for brevity

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lee Jones and committed by
Alex Deucher
1b98bc5d 1a308956

+38 -38
+38 -38
drivers/gpu/drm/amd/include/vega10_ip_offset.h
··· 35 35 }; 36 36 37 37 38 - static const struct IP_BASE NBIF_BASE = { { { { 0x00000000, 0x00000014, 0x00000D20, 0x00010400, 0 } }, 38 + static const struct IP_BASE __maybe_unused NBIF_BASE = { { { { 0x00000000, 0x00000014, 0x00000D20, 0x00010400, 0 } }, 39 39 { { 0, 0, 0, 0, 0 } }, 40 40 { { 0, 0, 0, 0, 0 } }, 41 41 { { 0, 0, 0, 0, 0 } }, 42 42 { { 0, 0, 0, 0, 0 } } } }; 43 - static const struct IP_BASE NBIO_BASE = { { { { 0x00000000, 0x00000014, 0x00000D20, 0x00010400, 0 } }, 43 + static const struct IP_BASE __maybe_unused NBIO_BASE = { { { { 0x00000000, 0x00000014, 0x00000D20, 0x00010400, 0 } }, 44 44 { { 0, 0, 0, 0, 0 } }, 45 45 { { 0, 0, 0, 0, 0 } }, 46 46 { { 0, 0, 0, 0, 0 } }, 47 47 { { 0, 0, 0, 0, 0 } } } }; 48 - static const struct IP_BASE DCE_BASE = { { { { 0x00000012, 0x000000C0, 0x000034C0, 0, 0 } }, 48 + static const struct IP_BASE __maybe_unused DCE_BASE = { { { { 0x00000012, 0x000000C0, 0x000034C0, 0, 0 } }, 49 49 { { 0, 0, 0, 0, 0 } }, 50 50 { { 0, 0, 0, 0, 0 } }, 51 51 { { 0, 0, 0, 0, 0 } }, 52 52 { { 0, 0, 0, 0, 0 } } } }; 53 - static const struct IP_BASE DCN_BASE = { { { { 0x00000012, 0x000000C0, 0x000034C0, 0, 0 } }, 53 + static const struct IP_BASE __maybe_unused DCN_BASE = { { { { 0x00000012, 0x000000C0, 0x000034C0, 0, 0 } }, 54 54 { { 0, 0, 0, 0, 0 } }, 55 55 { { 0, 0, 0, 0, 0 } }, 56 56 { { 0, 0, 0, 0, 0 } }, 57 57 { { 0, 0, 0, 0, 0 } } } }; 58 - static const struct IP_BASE MP0_BASE = { { { { 0x00016000, 0, 0, 0, 0 } }, 58 + static const struct IP_BASE __maybe_unused MP0_BASE = { { { { 0x00016000, 0, 0, 0, 0 } }, 59 59 { { 0, 0, 0, 0, 0 } }, 60 60 { { 0, 0, 0, 0, 0 } }, 61 61 { { 0, 0, 0, 0, 0 } }, 62 62 { { 0, 0, 0, 0, 0 } } } }; 63 - static const struct IP_BASE MP1_BASE = { { { { 0x00016000, 0, 0, 0, 0 } }, 63 + static const struct IP_BASE __maybe_unused MP1_BASE = { { { { 0x00016000, 0, 0, 0, 0 } }, 64 64 { { 0, 0, 0, 0, 0 } }, 65 65 { { 0, 0, 0, 0, 0 } }, 66 66 { { 0, 0, 0, 0, 0 } }, 67 67 { { 0, 0, 0, 0, 0 } } } }; 68 - static const struct IP_BASE MP2_BASE = { { { { 0x00016000, 0, 0, 0, 0 } }, 68 + static const struct IP_BASE __maybe_unused MP2_BASE = { { { { 0x00016000, 0, 0, 0, 0 } }, 69 69 { { 0, 0, 0, 0, 0 } }, 70 70 { { 0, 0, 0, 0, 0 } }, 71 71 { { 0, 0, 0, 0, 0 } }, 72 72 { { 0, 0, 0, 0, 0 } } } }; 73 - static const struct IP_BASE DF_BASE = { { { { 0x00007000, 0, 0, 0, 0 } }, 73 + static const struct IP_BASE __maybe_unused DF_BASE = { { { { 0x00007000, 0, 0, 0, 0 } }, 74 74 { { 0, 0, 0, 0, 0 } }, 75 75 { { 0, 0, 0, 0, 0 } }, 76 76 { { 0, 0, 0, 0, 0 } }, 77 77 { { 0, 0, 0, 0, 0 } } } }; 78 - static const struct IP_BASE UVD_BASE = { { { { 0x00007800, 0x00007E00, 0, 0, 0 } }, 78 + static const struct IP_BASE __maybe_unused UVD_BASE = { { { { 0x00007800, 0x00007E00, 0, 0, 0 } }, 79 79 { { 0, 0, 0, 0, 0 } }, 80 80 { { 0, 0, 0, 0, 0 } }, 81 81 { { 0, 0, 0, 0, 0 } }, 82 82 { { 0, 0, 0, 0, 0 } } } }; //note: GLN does not use the first segment 83 - static const struct IP_BASE VCN_BASE = { { { { 0x00007800, 0x00007E00, 0, 0, 0 } }, 83 + static const struct IP_BASE __maybe_unused VCN_BASE = { { { { 0x00007800, 0x00007E00, 0, 0, 0 } }, 84 84 { { 0, 0, 0, 0, 0 } }, 85 85 { { 0, 0, 0, 0, 0 } }, 86 86 { { 0, 0, 0, 0, 0 } }, 87 87 { { 0, 0, 0, 0, 0 } } } }; //note: GLN does not use the first segment 88 - static const struct IP_BASE DBGU_BASE = { { { { 0x00000180, 0x000001A0, 0, 0, 0 } }, 88 + static const struct IP_BASE __maybe_unused DBGU_BASE = { { { { 0x00000180, 0x000001A0, 0, 0, 0 } }, 89 89 { { 0, 0, 0, 0, 0 } }, 90 90 { { 0, 0, 0, 0, 0 } }, 91 91 { { 0, 0, 0, 0, 0 } }, 92 92 { { 0, 0, 0, 0, 0 } } } }; // not exist 93 - static const struct IP_BASE DBGU_NBIO_BASE = { { { { 0x000001C0, 0, 0, 0, 0 } }, 93 + static const struct IP_BASE __maybe_unused DBGU_NBIO_BASE = { { { { 0x000001C0, 0, 0, 0, 0 } }, 94 94 { { 0, 0, 0, 0, 0 } }, 95 95 { { 0, 0, 0, 0, 0 } }, 96 96 { { 0, 0, 0, 0, 0 } }, 97 97 { { 0, 0, 0, 0, 0 } } } }; // not exist 98 - static const struct IP_BASE DBGU_IO_BASE = { { { { 0x000001E0, 0, 0, 0, 0 } }, 98 + static const struct IP_BASE __maybe_unused DBGU_IO_BASE = { { { { 0x000001E0, 0, 0, 0, 0 } }, 99 99 { { 0, 0, 0, 0, 0 } }, 100 100 { { 0, 0, 0, 0, 0 } }, 101 101 { { 0, 0, 0, 0, 0 } }, 102 102 { { 0, 0, 0, 0, 0 } } } }; // not exist 103 - static const struct IP_BASE DFX_DAP_BASE = { { { { 0x000005A0, 0, 0, 0, 0 } }, 103 + static const struct IP_BASE __maybe_unused DFX_DAP_BASE = { { { { 0x000005A0, 0, 0, 0, 0 } }, 104 104 { { 0, 0, 0, 0, 0 } }, 105 105 { { 0, 0, 0, 0, 0 } }, 106 106 { { 0, 0, 0, 0, 0 } }, 107 107 { { 0, 0, 0, 0, 0 } } } }; // not exist 108 - static const struct IP_BASE DFX_BASE = { { { { 0x00000580, 0, 0, 0, 0 } }, 108 + static const struct IP_BASE __maybe_unused DFX_BASE = { { { { 0x00000580, 0, 0, 0, 0 } }, 109 109 { { 0, 0, 0, 0, 0 } }, 110 110 { { 0, 0, 0, 0, 0 } }, 111 111 { { 0, 0, 0, 0, 0 } }, 112 112 { { 0, 0, 0, 0, 0 } } } }; // this file does not contain registers 113 - static const struct IP_BASE ISP_BASE = { { { { 0x00018000, 0, 0, 0, 0 } }, 113 + static const struct IP_BASE __maybe_unused ISP_BASE = { { { { 0x00018000, 0, 0, 0, 0 } }, 114 114 { { 0, 0, 0, 0, 0 } }, 115 115 { { 0, 0, 0, 0, 0 } }, 116 116 { { 0, 0, 0, 0, 0 } }, 117 117 { { 0, 0, 0, 0, 0 } } } }; // not exist 118 - static const struct IP_BASE SYSTEMHUB_BASE = { { { { 0x00000EA0, 0, 0, 0, 0 } }, 118 + static const struct IP_BASE __maybe_unused SYSTEMHUB_BASE = { { { { 0x00000EA0, 0, 0, 0, 0 } }, 119 119 { { 0, 0, 0, 0, 0 } }, 120 120 { { 0, 0, 0, 0, 0 } }, 121 121 { { 0, 0, 0, 0, 0 } }, 122 122 { { 0, 0, 0, 0, 0 } } } }; // not exist 123 - static const struct IP_BASE L2IMU_BASE = { { { { 0x00007DC0, 0, 0, 0, 0 } }, 123 + static const struct IP_BASE __maybe_unused L2IMU_BASE = { { { { 0x00007DC0, 0, 0, 0, 0 } }, 124 124 { { 0, 0, 0, 0, 0 } }, 125 125 { { 0, 0, 0, 0, 0 } }, 126 126 { { 0, 0, 0, 0, 0 } }, 127 127 { { 0, 0, 0, 0, 0 } } } }; 128 - static const struct IP_BASE IOHC_BASE = { { { { 0x00010000, 0, 0, 0, 0 } }, 128 + static const struct IP_BASE __maybe_unused IOHC_BASE = { { { { 0x00010000, 0, 0, 0, 0 } }, 129 129 { { 0, 0, 0, 0, 0 } }, 130 130 { { 0, 0, 0, 0, 0 } }, 131 131 { { 0, 0, 0, 0, 0 } }, 132 132 { { 0, 0, 0, 0, 0 } } } }; 133 - static const struct IP_BASE ATHUB_BASE = { { { { 0x00000C20, 0, 0, 0, 0 } }, 133 + static const struct IP_BASE __maybe_unused ATHUB_BASE = { { { { 0x00000C20, 0, 0, 0, 0 } }, 134 134 { { 0, 0, 0, 0, 0 } }, 135 135 { { 0, 0, 0, 0, 0 } }, 136 136 { { 0, 0, 0, 0, 0 } }, 137 137 { { 0, 0, 0, 0, 0 } } } }; 138 - static const struct IP_BASE VCE_BASE = { { { { 0x00007E00, 0x00048800, 0, 0, 0 } }, 138 + static const struct IP_BASE __maybe_unused VCE_BASE = { { { { 0x00007E00, 0x00048800, 0, 0, 0 } }, 139 139 { { 0, 0, 0, 0, 0 } }, 140 140 { { 0, 0, 0, 0, 0 } }, 141 141 { { 0, 0, 0, 0, 0 } }, 142 142 { { 0, 0, 0, 0, 0 } } } }; 143 - static const struct IP_BASE GC_BASE = { { { { 0x00002000, 0x0000A000, 0, 0, 0 } }, 143 + static const struct IP_BASE __maybe_unused GC_BASE = { { { { 0x00002000, 0x0000A000, 0, 0, 0 } }, 144 144 { { 0, 0, 0, 0, 0 } }, 145 145 { { 0, 0, 0, 0, 0 } }, 146 146 { { 0, 0, 0, 0, 0 } }, 147 147 { { 0, 0, 0, 0, 0 } } } }; 148 - static const struct IP_BASE MMHUB_BASE = { { { { 0x0001A000, 0, 0, 0, 0 } }, 148 + static const struct IP_BASE __maybe_unused MMHUB_BASE = { { { { 0x0001A000, 0, 0, 0, 0 } }, 149 149 { { 0, 0, 0, 0, 0 } }, 150 150 { { 0, 0, 0, 0, 0 } }, 151 151 { { 0, 0, 0, 0, 0 } }, 152 152 { { 0, 0, 0, 0, 0 } } } }; 153 - static const struct IP_BASE RSMU_BASE = { { { { 0x00012000, 0, 0, 0, 0 } }, 153 + static const struct IP_BASE __maybe_unused RSMU_BASE = { { { { 0x00012000, 0, 0, 0, 0 } }, 154 154 { { 0, 0, 0, 0, 0 } }, 155 155 { { 0, 0, 0, 0, 0 } }, 156 156 { { 0, 0, 0, 0, 0 } }, 157 157 { { 0, 0, 0, 0, 0 } } } }; 158 - static const struct IP_BASE HDP_BASE = { { { { 0x00000F20, 0, 0, 0, 0 } }, 158 + static const struct IP_BASE __maybe_unused HDP_BASE = { { { { 0x00000F20, 0, 0, 0, 0 } }, 159 159 { { 0, 0, 0, 0, 0 } }, 160 160 { { 0, 0, 0, 0, 0 } }, 161 161 { { 0, 0, 0, 0, 0 } }, 162 162 { { 0, 0, 0, 0, 0 } } } }; 163 - static const struct IP_BASE OSSSYS_BASE = { { { { 0x000010A0, 0, 0, 0, 0 } }, 163 + static const struct IP_BASE __maybe_unused OSSSYS_BASE = { { { { 0x000010A0, 0, 0, 0, 0 } }, 164 164 { { 0, 0, 0, 0, 0 } }, 165 165 { { 0, 0, 0, 0, 0 } }, 166 166 { { 0, 0, 0, 0, 0 } }, 167 167 { { 0, 0, 0, 0, 0 } } } }; 168 - static const struct IP_BASE SDMA0_BASE = { { { { 0x00001260, 0, 0, 0, 0 } }, 168 + static const struct IP_BASE __maybe_unused SDMA0_BASE = { { { { 0x00001260, 0, 0, 0, 0 } }, 169 169 { { 0, 0, 0, 0, 0 } }, 170 170 { { 0, 0, 0, 0, 0 } }, 171 171 { { 0, 0, 0, 0, 0 } }, 172 172 { { 0, 0, 0, 0, 0 } } } }; 173 - static const struct IP_BASE SDMA1_BASE = { { { { 0x00001460, 0, 0, 0, 0 } }, 173 + static const struct IP_BASE __maybe_unused SDMA1_BASE = { { { { 0x00001460, 0, 0, 0, 0 } }, 174 174 { { 0, 0, 0, 0, 0 } }, 175 175 { { 0, 0, 0, 0, 0 } }, 176 176 { { 0, 0, 0, 0, 0 } }, 177 177 { { 0, 0, 0, 0, 0 } } } }; 178 - static const struct IP_BASE XDMA_BASE = { { { { 0x00003400, 0, 0, 0, 0 } }, 178 + static const struct IP_BASE __maybe_unused XDMA_BASE = { { { { 0x00003400, 0, 0, 0, 0 } }, 179 179 { { 0, 0, 0, 0, 0 } }, 180 180 { { 0, 0, 0, 0, 0 } }, 181 181 { { 0, 0, 0, 0, 0 } }, 182 182 { { 0, 0, 0, 0, 0 } } } }; 183 - static const struct IP_BASE UMC_BASE = { { { { 0x00014000, 0, 0, 0, 0 } }, 183 + static const struct IP_BASE __maybe_unused UMC_BASE = { { { { 0x00014000, 0, 0, 0, 0 } }, 184 184 { { 0, 0, 0, 0, 0 } }, 185 185 { { 0, 0, 0, 0, 0 } }, 186 186 { { 0, 0, 0, 0, 0 } }, 187 187 { { 0, 0, 0, 0, 0 } } } }; 188 - static const struct IP_BASE THM_BASE = { { { { 0x00016600, 0, 0, 0, 0 } }, 188 + static const struct IP_BASE __maybe_unused THM_BASE = { { { { 0x00016600, 0, 0, 0, 0 } }, 189 189 { { 0, 0, 0, 0, 0 } }, 190 190 { { 0, 0, 0, 0, 0 } }, 191 191 { { 0, 0, 0, 0, 0 } }, 192 192 { { 0, 0, 0, 0, 0 } } } }; 193 - static const struct IP_BASE SMUIO_BASE = { { { { 0x00016800, 0, 0, 0, 0 } }, 193 + static const struct IP_BASE __maybe_unused SMUIO_BASE = { { { { 0x00016800, 0, 0, 0, 0 } }, 194 194 { { 0, 0, 0, 0, 0 } }, 195 195 { { 0, 0, 0, 0, 0 } }, 196 196 { { 0, 0, 0, 0, 0 } }, 197 197 { { 0, 0, 0, 0, 0 } } } }; 198 - static const struct IP_BASE PWR_BASE = { { { { 0x00016A00, 0, 0, 0, 0 } }, 198 + static const struct IP_BASE __maybe_unused PWR_BASE = { { { { 0x00016A00, 0, 0, 0, 0 } }, 199 199 { { 0, 0, 0, 0, 0 } }, 200 200 { { 0, 0, 0, 0, 0 } }, 201 201 { { 0, 0, 0, 0, 0 } }, 202 202 { { 0, 0, 0, 0, 0 } } } }; 203 - static const struct IP_BASE CLK_BASE = { { { { 0x00016C00, 0, 0, 0, 0 } }, 204 - { { 0x00016E00, 0, 0, 0, 0 } }, 203 + static const struct IP_BASE __maybe_unused CLK_BASE = { { { { 0x00016C00, 0, 0, 0, 0 } }, 204 + { { 0x00016E00, 0, 0, 0, 0 } }, 205 205 { { 0x00017000, 0, 0, 0, 0 } }, 206 - { { 0x00017200, 0, 0, 0, 0 } }, 207 - { { 0x00017E00, 0, 0, 0, 0 } } } }; 208 - static const struct IP_BASE FUSE_BASE = { { { { 0x00017400, 0, 0, 0, 0 } }, 206 + { { 0x00017200, 0, 0, 0, 0 } }, 207 + { { 0x00017E00, 0, 0, 0, 0 } } } }; 208 + static const struct IP_BASE __maybe_unused FUSE_BASE = { { { { 0x00017400, 0, 0, 0, 0 } }, 209 209 { { 0, 0, 0, 0, 0 } }, 210 210 { { 0, 0, 0, 0, 0 } }, 211 211 { { 0, 0, 0, 0, 0 } },