Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586039

Re: [PATCH V10 07/10] efi: print unrecognized CPER section

From James Morse <james.morse@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH V10 07/10] efi: print unrecognized CPER section
Date 2017-02-22 11:20 +0100
Message-ID <tdCbE-6u-15@gated-at.bofh.it> (permalink)
References <tbdU5-4d3-1@gated-at.bofh.it> <tbdU6-4d3-39@gated-at.bofh.it> <tdo8H-6Sm-61@gated-at.bofh.it> <tdtL4-2dO-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 22/02/17 01:12, Russell King - ARM Linux wrote:
> On Tue, Feb 21, 2017 at 07:10:11PM +0000, James Morse wrote:
>> Hi Tyler,
>>
>> On 15/02/17 19:51, Tyler Baicar wrote:
>>> +	} else {
>>> +		const void *unknown_err;
>>> +
>>> +		unknown_err = acpi_hest_generic_data_payload(gdata);
>>> +		printk("%ssection type: %pUl\n", newpfx, sec_type);
>>> +		printk("%ssection length: %d\n", newpfx,
>>
>> Nit: please use the "%s""section... that this file consistently uses. This means
>> this code will still work as expected when someone adds '%ss' support to printk!
> 
> No.  That is wrong:
> 
> "%s""section" is stored in memory as bytes containing:
> 
> '%' 's' 's' 'e' 'c' 't' 'i' 'o' 'n'
> 
> whereas "%ssection" is stored in memory as bytes containing:
> 
> '%' 's' 's' 'e' 'c' 't' 'i' 'o' 'n'
> 
> They're exactly the same, so when printk() comes to parse the string, it
> sees exactly the same byte sequence.  So, the only thing that's happening
> is code obfuscation for no good reason what so ever.
> 
> If you don't believe me, run some build tests and look at the resulting
> strings... also look at the C standard.  "Adjacent string literal tokens
> are concatenated."
> 
> Please get rid of this obfuscation.

Sure, I was always told not do this, clearly I didn't think about it for very long!

This file otherwise consistently uses the now-weird "%s""otherstring" pattern.



Thanks,

James

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH V10 00/10] Add UEFI 2.6 and ACPI 6.1 updates for RAS on ARM64 Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
  [PATCH V10 02/10] ras: acpi/apei: cper: generic error data entry v3 per ACPI 6.1 Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
    Re: [PATCH V10 02/10] ras: acpi/apei: cper: generic error data entry  v3 per ACPI 6.1 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-02-16 19:30 +0100
  [PATCH V10 03/10] efi: parse ARM processor error Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
    Re: [PATCH V10 03/10] efi: parse ARM processor error Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-02-16 19:30 +0100
  [PATCH V10 09/10] trace, ras: add ARM processor error trace event Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
  [PATCH V10 01/10] acpi: apei: read ack upon ghes record consumption Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
  [PATCH V10 04/10] arm64: exception: handle Synchronous External Abort Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
  [PATCH V10 06/10] acpi: apei: panic OS with fatal error status block Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
  [PATCH V10 05/10] acpi: apei: handle SEA notification type for ARMv8 Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
    Re: [PATCH V10 05/10] acpi: apei: handle SEA notification type for ARMv8 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-02-16 19:40 +0100
      Re: [PATCH V10 05/10] acpi: apei: handle SEA notification type for  ARMv8 "Baicar, Tyler" <tbaicar@codeaurora.org> - 2017-02-21 18:00 +0100
  [PATCH V10 08/10] ras: acpi / apei: generate trace event for unrecognized CPER section Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
  [PATCH V10 10/10] arm/arm64: KVM: add guest SEA support Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
  [PATCH V10 07/10] efi: print unrecognized CPER section Tyler Baicar <tbaicar@codeaurora.org> - 2017-02-15 21:00 +0100
    Re: [PATCH V10 07/10] efi: print unrecognized CPER section Joe Perches <joe@perches.com> - 2017-02-15 21:10 +0100
      Re: [PATCH V10 07/10] efi: print unrecognized CPER section "Baicar, Tyler" <tbaicar@codeaurora.org> - 2017-02-15 21:40 +0100
    Re: [PATCH V10 07/10] efi: print unrecognized CPER section James Morse <james.morse@arm.com> - 2017-02-21 20:20 +0100
      Re: [PATCH V10 07/10] efi: print unrecognized CPER section "Baicar, Tyler" <tbaicar@codeaurora.org> - 2017-02-21 20:40 +0100
        Re: [PATCH V10 07/10] efi: print unrecognized CPER section Joe Perches <joe@perches.com> - 2017-02-22 01:40 +0100
      Re: [PATCH V10 07/10] efi: print unrecognized CPER section Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-22 02:20 +0100
        Re: [PATCH V10 07/10] efi: print unrecognized CPER section James Morse <james.morse@arm.com> - 2017-02-22 11:20 +0100

csiph-web