Received: by 10.223.185.111 with SMTP id b44csp37977wrg; Fri, 9 Mar 2018 00:20:57 -0800 (PST) X-Google-Smtp-Source: AG47ELuz0dSpJ2ZAeppTSRGdu9fMDHsqR3DExmnpvCNY04LOIJ84u7NOITpfPQfbNoNckZNlxTvr X-Received: by 10.98.66.89 with SMTP id p86mr29018680pfa.228.1520583657557; Fri, 09 Mar 2018 00:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520583657; cv=none; d=google.com; s=arc-20160816; b=DxusgRNukcxxa93SFqc7bgPFGNYv5+eFLtPXA2W6CQ8vLpmFcgqYbW/zYtBQH+CQPz qYWr1Gz1G3PmhtIdJcdC6NjQjeltzzLfuql4BKDiq9gy4n0+onn7rmwaWP8R8xMMoCVG jNTpne/DrjpNGJnWxdEwfMDtaxfIe1cWAJe89dtd2nO2JfkSxVpypl5i2ryTPkCxcxxv tLLFSEY32VwTwg5Z6Gw3/2PcNA8aC9UMFwVrhh0NHD0s2nW1Kpi+9r2zggqbB8Y3ocKY oHsc7PLQB4uCtbm6Qn7r/EHCOpBIhBYOuY7DIvy/1scSUAap0z5ZTZg3N25p1BNbMSXJ B3aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Nk2iasK3elyfad1/aX9bqsFL3hNt+hloFsFtVfiEnT8=; b=lzv6cH2s6vqo2xvkoKkuhAmQ1Kr7MESckNkIuXBmEarGMf2mnVOzqNFAbP4/ORlKAg EeiaRWQzqvE/H/IQsyVFhtTYftHiAKMlVQsUSlBaJkbBNCOnmqY9VScFkpnbNpN01sus 10olvJQIWf0nHZ5tLAl9QR+A6+I2L/A71+hmeogKjYqD2Dhf8cDKUF+ecipmFzadq1yy nSfJaDb6TGThD8Bi/IidwPRNbK8NQOjB5X4pvZI53wPabaiajKQjphccTkDb6hAYe06l Wv42pMXRaJqnqfPIg4/XnMIYBKqUpGEqkkKHHx4Ar/ccXDGv1Hc55BDthaYzHNcjdB1H TvGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aAQrn6FI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e123si403122pgc.406.2018.03.09.00.20.42; Fri, 09 Mar 2018 00:20:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aAQrn6FI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751498AbeCIITx (ORCPT + 99 others); Fri, 9 Mar 2018 03:19:53 -0500 Received: from mail-oi0-f45.google.com ([209.85.218.45]:42625 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193AbeCIITv (ORCPT ); Fri, 9 Mar 2018 03:19:51 -0500 Received: by mail-oi0-f45.google.com with SMTP id c18so6390071oiy.9 for ; Fri, 09 Mar 2018 00:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Nk2iasK3elyfad1/aX9bqsFL3hNt+hloFsFtVfiEnT8=; b=aAQrn6FIZBC1tm0orU7lXSbrEpogemhE7l6B9G1rebQMo1/sEAjKkECvHu52deIdws X7ErmMOMAW6lZmknTNPnxQEcXQQ2Hb7h1kdpc+u4zB8T4wLu3b7pwgVORI4+856kEXJU tySVKY3V4BL3GnZBL3eRd71wU90E/m4YmYnsI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Nk2iasK3elyfad1/aX9bqsFL3hNt+hloFsFtVfiEnT8=; b=cONYp8N/9jawG+/yk//4i+Bkeug7xab+LRIHevIyMUlr3xFwYUfMdiTvmmJHnPYlKb eoIYPAmS5lWP6IxhFs7uVmZFYEw1NKnpklkA6cwNO/u9ULyKS7BgLtG73eXCE/cTxKxE DivRWKQHlEJbOZhoPK3ILHKqLiim5boke72+CqOndQMnw118R8BMyW6dax33MIdlk8fl UWWFs67Ewfh6IF8vJHmTt1xfOmXqs4h7KmLBnmI9d3tnKqlAPpv4agFeTuEPs766xMqV fY5jh9TFDhVi+Wtx/gPwrw4Mix+YVhpkADiUiaeokYWyI7d7It4VEnHx1k1YNWd5P3dA 9lsQ== X-Gm-Message-State: AElRT7FR6I2/YE7aQVgdhLY+bUpJCC028dk58a/ybc78SWzDIzPaD2Pr GUSJirc+uenAA9xUcGAwgeE8m4sFub0BzL4bpzSTUw== X-Received: by 10.202.45.3 with SMTP id t3mr6686087oit.22.1520583590833; Fri, 09 Mar 2018 00:19:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.13.2 with HTTP; Fri, 9 Mar 2018 00:19:50 -0800 (PST) In-Reply-To: References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> <20180308080020.22828-13-ard.biesheuvel@linaro.org> <20180309074719.y33xe4bjkjsjsaa3@gmail.com> <20180309080428.atur6wcbb6vtonhz@gmail.com> From: Ard Biesheuvel Date: Fri, 9 Mar 2018 08:19:50 +0000 Message-ID: Subject: Re: [PATCH 12/12] efi: make const array 'apple' static To: Ingo Molnar Cc: linux-efi@vger.kernel.org, Thomas Gleixner , Colin Ian King , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9 March 2018 at 08:07, Ard Biesheuvel wrote: > On 9 March 2018 at 08:04, Ingo Molnar wrote: >> >> * Ard Biesheuvel wrote: >> >>> > Also, would it make sense to rename it to something more descriptive like >>> > "apple_unicode_str[]" or so? >>> > >>> > Plus an unicode string literal initializer would be pretty descriptive as well, >>> > instead of the weird looking character array, i.e. something like: >>> > >>> > static efi_char16_t const apple_unicode_str[] = u"Apple"; >>> > >>> > ... or so? >>> > >>> >>> is u"xxx" the same as L"xxx"? >> >> So "L" literals map to wchar_t, which wide character type is implementation >> specific IIRC, could be 16-bit or 32-bit wide. >> >> u"" literals OTOH are specified by the C11 spec to be char16_t, i.e. 16-bit wide >> characters - which I assume is the EFI type as well? >> >>> In any case, this is for historical reasons: at some point (and I >>> don't remember the exact details) we had a conflict at link time with >>> objects using 4 byte wchar_t, so we started using this notation to be >>> independent of the size of wchar_t. That issue no longer exists so we >>> should be able to get rid of this. >> >> Yes, my guess is that those problems were due to L"xyz" mapping to wchar_t and >> having a different type in the kernel build and the host build side - but u"xyz" >> should solve that. >> > > Excellent! > > Do you mind taking this patch as is? I will follow up with a patch > that updates all occurrences of this pattern (we have a few of them), > i.e., use u"" notation and move them to file scope. OK, I misremembered: the other occurrences have already been moved to file scope a while ago. I will follow up with a patch that switches to u"" notation, please let me know if I should respin this or not