diff options
| author | Anders Roxell <anders.roxell@linaro.org> | 2019-02-15 11:55:51 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2019-02-16 06:18:55 -0500 |
| commit | 5c418dc789a3898717ebf2caa5716ba91a7150b2 (patch) | |
| tree | a89dc3170a533b2544259891f845e65c498c274a /drivers | |
| parent | 69c1f396f25b805aeff08f06d2e992c315ee5b1e (diff) | |
efi: Fix build error due to enum collision between efi.h and ima.h
The following commit:
a893ea15d764 ("tpm: move tpm_chip definition to include/linux/tpm.h")
introduced a build error when both IMA and EFI are enabled:
In file included from ../security/integrity/ima/ima_fs.c:30:
../security/integrity/ima/ima.h:176:7: error: redeclaration of enumerator "NONE"
What happens is that both headers (ima.h and efi.h) defines the same
'NONE' constant, and it broke when they started getting included from
the same file:
Rework to prefix the EFI enum with 'EFI_*'.
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20190215165551.12220-2-ard.biesheuvel@linaro.org
[ Cleaned up the changelog a bit. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/firmware/efi/runtime-wrappers.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 8903b9ccfc2b..8bbbbf160d05 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c | |||
| @@ -85,7 +85,7 @@ struct efi_runtime_work efi_rts_work; | |||
| 85 | pr_err("Failed to queue work to efi_rts_wq.\n"); \ | 85 | pr_err("Failed to queue work to efi_rts_wq.\n"); \ |
| 86 | \ | 86 | \ |
| 87 | exit: \ | 87 | exit: \ |
| 88 | efi_rts_work.efi_rts_id = NONE; \ | 88 | efi_rts_work.efi_rts_id = EFI_NONE; \ |
| 89 | efi_rts_work.status; \ | 89 | efi_rts_work.status; \ |
| 90 | }) | 90 | }) |
| 91 | 91 | ||
| @@ -168,50 +168,50 @@ static void efi_call_rts(struct work_struct *work) | |||
| 168 | arg5 = efi_rts_work.arg5; | 168 | arg5 = efi_rts_work.arg5; |
| 169 | 169 | ||
| 170 | switch (efi_rts_work.efi_rts_id) { | 170 | switch (efi_rts_work.efi_rts_id) { |
| 171 | case GET_TIME: | 171 | case EFI_GET_TIME: |
| 172 | status = efi_call_virt(get_time, (efi_time_t *)arg1, | 172 | status = efi_call_virt(get_time, (efi_time_t *)arg1, |
| 173 | (efi_time_cap_t *)arg2); | 173 | (efi_time_cap_t *)arg2); |
| 174 | break; | 174 | break; |
| 175 | case SET_TIME: | 175 | case EFI_SET_TIME: |
| 176 | status = efi_call_virt(set_time, (efi_time_t *)arg1); | 176 | status = efi_call_virt(set_time, (efi_time_t *)arg1); |
| 177 | break; | 177 | break; |
| 178 | case GET_WAKEUP_TIME: | 178 | case EFI_GET_WAKEUP_TIME: |
| 179 | status = efi_call_virt(get_wakeup_time, (efi_bool_t *)arg1, | 179 | status = efi_call_virt(get_wakeup_time, (efi_bool_t *)arg1, |
| 180 | (efi_bool_t *)arg2, (efi_time_t *)arg3); | 180 | (efi_bool_t *)arg2, (efi_time_t *)arg3); |
| 181 | break; | 181 | break; |
| 182 | case SET_WAKEUP_TIME: | 182 | case EFI_SET_WAKEUP_TIME: |
| 183 | status = efi_call_virt(set_wakeup_time, *(efi_bool_t *)arg1, | 183 | status = efi_call_virt(set_wakeup_time, *(efi_bool_t *)arg1, |
| 184 | (efi_time_t *)arg2); | 184 | (efi_time_t *)arg2); |
| 185 | break; | 185 | break; |
| 186 | case GET_VARIABLE: | 186 | case EFI_GET_VARIABLE: |
| 187 | status = efi_call_virt(get_variable, (efi_char16_t *)arg1, | 187 | status = efi_call_virt(get_variable, (efi_char16_t *)arg1, |
| 188 | (efi_guid_t *)arg2, (u32 *)arg3, | 188 | (efi_guid_t *)arg2, (u32 *)arg3, |
| 189 | (unsigned long *)arg4, (void *)arg5); | 189 | (unsigned long *)arg4, (void *)arg5); |
| 190 | break; | 190 | break; |
| 191 | case GET_NEXT_VARIABLE: | 191 | case EFI_GET_NEXT_VARIABLE: |
| 192 | status = efi_call_virt(get_next_variable, (unsigned long *)arg1, | 192 | status = efi_call_virt(get_next_variable, (unsigned long *)arg1, |
| 193 | (efi_char16_t *)arg2, | 193 | (efi_char16_t *)arg2, |
| 194 | (efi_guid_t *)arg3); | 194 | (efi_guid_t *)arg3); |
| 195 | break; | 195 | break; |
| 196 | case SET_VARIABLE: | 196 | case EFI_SET_VARIABLE: |
| 197 | status = efi_call_virt(set_variable, (efi_char16_t *)arg1, | 197 | status = efi_call_virt(set_variable, (efi_char16_t *)arg1, |
| 198 | (efi_guid_t *)arg2, *(u32 *)arg3, | 198 | (efi_guid_t *)arg2, *(u32 *)arg3, |
| 199 | *(unsigned long *)arg4, (void *)arg5); | 199 | *(unsigned long *)arg4, (void *)arg5); |
| 200 | break; | 200 | break; |
| 201 | case QUERY_VARIABLE_INFO: | 201 | case EFI_QUERY_VARIABLE_INFO: |
| 202 | status = efi_call_virt(query_variable_info, *(u32 *)arg1, | 202 | status = efi_call_virt(query_variable_info, *(u32 *)arg1, |
| 203 | (u64 *)arg2, (u64 *)arg3, (u64 *)arg4); | 203 | (u64 *)arg2, (u64 *)arg3, (u64 *)arg4); |
| 204 | break; | 204 | break; |
| 205 | case GET_NEXT_HIGH_MONO_COUNT: | 205 | case EFI_GET_NEXT_HIGH_MONO_COUNT: |
| 206 | status = efi_call_virt(get_next_high_mono_count, (u32 *)arg1); | 206 | status = efi_call_virt(get_next_high_mono_count, (u32 *)arg1); |
| 207 | break; | 207 | break; |
| 208 | case UPDATE_CAPSULE: | 208 | case EFI_UPDATE_CAPSULE: |
| 209 | status = efi_call_virt(update_capsule, | 209 | status = efi_call_virt(update_capsule, |
| 210 | (efi_capsule_header_t **)arg1, | 210 | (efi_capsule_header_t **)arg1, |
| 211 | *(unsigned long *)arg2, | 211 | *(unsigned long *)arg2, |
| 212 | *(unsigned long *)arg3); | 212 | *(unsigned long *)arg3); |
| 213 | break; | 213 | break; |
| 214 | case QUERY_CAPSULE_CAPS: | 214 | case EFI_QUERY_CAPSULE_CAPS: |
| 215 | status = efi_call_virt(query_capsule_caps, | 215 | status = efi_call_virt(query_capsule_caps, |
| 216 | (efi_capsule_header_t **)arg1, | 216 | (efi_capsule_header_t **)arg1, |
| 217 | *(unsigned long *)arg2, (u64 *)arg3, | 217 | *(unsigned long *)arg2, (u64 *)arg3, |
| @@ -235,7 +235,7 @@ static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) | |||
| 235 | 235 | ||
| 236 | if (down_interruptible(&efi_runtime_lock)) | 236 | if (down_interruptible(&efi_runtime_lock)) |
| 237 | return EFI_ABORTED; | 237 | return EFI_ABORTED; |
| 238 | status = efi_queue_work(GET_TIME, tm, tc, NULL, NULL, NULL); | 238 | status = efi_queue_work(EFI_GET_TIME, tm, tc, NULL, NULL, NULL); |
| 239 | up(&efi_runtime_lock); | 239 | up(&efi_runtime_lock); |
| 240 | return status; | 240 | return status; |
| 241 | } | 241 | } |
| @@ -246,7 +246,7 @@ static efi_status_t virt_efi_set_time(efi_time_t *tm) | |||
| 246 | 246 | ||
| 247 | if (down_interruptible(&efi_runtime_lock)) | 247 | if (down_interruptible(&efi_runtime_lock)) |
| 248 | return EFI_ABORTED; | 248 | return EFI_ABORTED; |
| 249 | status = efi_queue_work(SET_TIME, tm, NULL, NULL, NULL, NULL); | 249 | status = efi_queue_work(EFI_SET_TIME, tm, NULL, NULL, NULL, NULL); |
| 250 | up(&efi_runtime_lock); | 250 | up(&efi_runtime_lock); |
| 251 | return status; | 251 | return status; |
| 252 | } | 252 | } |
| @@ -259,7 +259,7 @@ static efi_status_t virt_efi_get_wakeup_time(efi_bool_t *enabled, | |||
| 259 | 259 | ||
| 260 | if (down_interruptible(&efi_runtime_lock)) | 260 | if (down_interruptible(&efi_runtime_lock)) |
| 261 | return EFI_ABORTED; | 261 | return EFI_ABORTED; |
| 262 | status = efi_queue_work(GET_WAKEUP_TIME, enabled, pending, tm, NULL, | 262 | status = efi_queue_work(EFI_GET_WAKEUP_TIME, enabled, pending, tm, NULL, |
| 263 | NULL); | 263 | NULL); |
| 264 | up(&efi_runtime_lock); | 264 | up(&efi_runtime_lock); |
| 265 | return status; | 265 | return status; |
| @@ -271,7 +271,7 @@ static efi_status_t virt_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) | |||
| 271 | 271 | ||
| 272 | if (down_interruptible(&efi_runtime_lock)) | 272 | if (down_interruptible(&efi_runtime_lock)) |
| 273 | return EFI_ABORTED; | 273 | return EFI_ABORTED; |
| 274 | status = efi_queue_work(SET_WAKEUP_TIME, &enabled, tm, NULL, NULL, | 274 | status = efi_queue_work(EFI_SET_WAKEUP_TIME, &enabled, tm, NULL, NULL, |
| 275 | NULL); | 275 | NULL); |
| 276 | up(&efi_runtime_lock); | 276 | up(&efi_runtime_lock); |
| 277 | return status; | 277 | return status; |
| @@ -287,7 +287,7 @@ static efi_status_t virt_efi_get_variable(efi_char16_t *name, | |||
| 287 | 287 | ||
| 288 | if (down_interruptible(&efi_runtime_lock)) | 288 | if (down_interruptible(&efi_runtime_lock)) |
| 289 | return EFI_ABORTED; | 289 | return EFI_ABORTED; |
| 290 | status = efi_queue_work(GET_VARIABLE, name, vendor, attr, data_size, | 290 | status = efi_queue_work(EFI_GET_VARIABLE, name, vendor, attr, data_size, |
| 291 | data); | 291 | data); |
| 292 | up(&efi_runtime_lock); | 292 | up(&efi_runtime_lock); |
| 293 | return status; | 293 | return status; |
| @@ -301,7 +301,7 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, | |||
| 301 | 301 | ||
| 302 | if (down_interruptible(&efi_runtime_lock)) | 302 | if (down_interruptible(&efi_runtime_lock)) |
| 303 | return EFI_ABORTED; | 303 | return EFI_ABORTED; |
| 304 | status = efi_queue_work(GET_NEXT_VARIABLE, name_size, name, vendor, | 304 | status = efi_queue_work(EFI_GET_NEXT_VARIABLE, name_size, name, vendor, |
| 305 | NULL, NULL); | 305 | NULL, NULL); |
| 306 | up(&efi_runtime_lock); | 306 | up(&efi_runtime_lock); |
| 307 | return status; | 307 | return status; |
| @@ -317,7 +317,7 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name, | |||
| 317 | 317 | ||
| 318 | if (down_interruptible(&efi_runtime_lock)) | 318 | if (down_interruptible(&efi_runtime_lock)) |
| 319 | return EFI_ABORTED; | 319 | return EFI_ABORTED; |
| 320 | status = efi_queue_work(SET_VARIABLE, name, vendor, &attr, &data_size, | 320 | status = efi_queue_work(EFI_SET_VARIABLE, name, vendor, &attr, &data_size, |
| 321 | data); | 321 | data); |
| 322 | up(&efi_runtime_lock); | 322 | up(&efi_runtime_lock); |
| 323 | return status; | 323 | return status; |
| @@ -352,7 +352,7 @@ static efi_status_t virt_efi_query_variable_info(u32 attr, | |||
| 352 | 352 | ||
| 353 | if (down_interruptible(&efi_runtime_lock)) | 353 | if (down_interruptible(&efi_runtime_lock)) |
| 354 | return EFI_ABORTED; | 354 | return EFI_ABORTED; |
| 355 | status = efi_queue_work(QUERY_VARIABLE_INFO, &attr, storage_space, | 355 | status = efi_queue_work(EFI_QUERY_VARIABLE_INFO, &attr, storage_space, |
| 356 | remaining_space, max_variable_size, NULL); | 356 | remaining_space, max_variable_size, NULL); |
| 357 | up(&efi_runtime_lock); | 357 | up(&efi_runtime_lock); |
| 358 | return status; | 358 | return status; |
| @@ -384,7 +384,7 @@ static efi_status_t virt_efi_get_next_high_mono_count(u32 *count) | |||
| 384 | 384 | ||
| 385 | if (down_interruptible(&efi_runtime_lock)) | 385 | if (down_interruptible(&efi_runtime_lock)) |
| 386 | return EFI_ABORTED; | 386 | return EFI_ABORTED; |
| 387 | status = efi_queue_work(GET_NEXT_HIGH_MONO_COUNT, count, NULL, NULL, | 387 | status = efi_queue_work(EFI_GET_NEXT_HIGH_MONO_COUNT, count, NULL, NULL, |
| 388 | NULL, NULL); | 388 | NULL, NULL); |
| 389 | up(&efi_runtime_lock); | 389 | up(&efi_runtime_lock); |
| 390 | return status; | 390 | return status; |
| @@ -400,7 +400,7 @@ static void virt_efi_reset_system(int reset_type, | |||
| 400 | "could not get exclusive access to the firmware\n"); | 400 | "could not get exclusive access to the firmware\n"); |
| 401 | return; | 401 | return; |
| 402 | } | 402 | } |
| 403 | efi_rts_work.efi_rts_id = RESET_SYSTEM; | 403 | efi_rts_work.efi_rts_id = EFI_RESET_SYSTEM; |
| 404 | __efi_call_virt(reset_system, reset_type, status, data_size, data); | 404 | __efi_call_virt(reset_system, reset_type, status, data_size, data); |
| 405 | up(&efi_runtime_lock); | 405 | up(&efi_runtime_lock); |
| 406 | } | 406 | } |
| @@ -416,7 +416,7 @@ static efi_status_t virt_efi_update_capsule(efi_capsule_header_t **capsules, | |||
| 416 | 416 | ||
| 417 | if (down_interruptible(&efi_runtime_lock)) | 417 | if (down_interruptible(&efi_runtime_lock)) |
| 418 | return EFI_ABORTED; | 418 | return EFI_ABORTED; |
| 419 | status = efi_queue_work(UPDATE_CAPSULE, capsules, &count, &sg_list, | 419 | status = efi_queue_work(EFI_UPDATE_CAPSULE, capsules, &count, &sg_list, |
| 420 | NULL, NULL); | 420 | NULL, NULL); |
| 421 | up(&efi_runtime_lock); | 421 | up(&efi_runtime_lock); |
| 422 | return status; | 422 | return status; |
| @@ -434,7 +434,7 @@ static efi_status_t virt_efi_query_capsule_caps(efi_capsule_header_t **capsules, | |||
| 434 | 434 | ||
| 435 | if (down_interruptible(&efi_runtime_lock)) | 435 | if (down_interruptible(&efi_runtime_lock)) |
| 436 | return EFI_ABORTED; | 436 | return EFI_ABORTED; |
| 437 | status = efi_queue_work(QUERY_CAPSULE_CAPS, capsules, &count, | 437 | status = efi_queue_work(EFI_QUERY_CAPSULE_CAPS, capsules, &count, |
| 438 | max_size, reset_type, NULL); | 438 | max_size, reset_type, NULL); |
| 439 | up(&efi_runtime_lock); | 439 | up(&efi_runtime_lock); |
| 440 | return status; | 440 | return status; |
