From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753784AbdBVBNn (ORCPT ); Tue, 21 Feb 2017 20:13:43 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:46956 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301AbdBVBNf (ORCPT ); Tue, 21 Feb 2017 20:13:35 -0500 Date: Wed, 22 Feb 2017 01:12:42 +0000 From: Russell King - ARM Linux To: James Morse Cc: Tyler Baicar , christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, matt@codeblueprint.co.uk, robert.moore@intel.com, lv.zheng@intel.com, nkaje@codeaurora.org, zjzhang@codeaurora.org, mark.rutland@arm.com, akpm@linux-foundation.org, eun.taik.lee@samsung.com, sandeepa.s.prabhu@gmail.com, labbott@redhat.com, shijie.huang@arm.com, rruigrok@codeaurora.org, paul.gortmaker@windriver.com, tn@semihalf.com, fu.wei@linaro.org, rostedt@goodmis.org, bristot@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, devel@acpica.org, Suzuki.Poulose@arm.com, punit.agrawal@arm.com, astone@redhat.com, harba@codeaurora.org, hanjun.guo@linaro.org, john.garry@huawei.com, shiju.jose@huawei.com Subject: Re: [PATCH V10 07/10] efi: print unrecognized CPER section Message-ID: <20170222011241.GX21222@n2100.armlinux.org.uk> References: <1487188282-2568-1-git-send-email-tbaicar@codeaurora.org> <1487188282-2568-8-git-send-email-tbaicar@codeaurora.org> <58AC9093.5020303@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58AC9093.5020303@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.