Received: by 10.223.185.111 with SMTP id b44csp28763wrg; Fri, 9 Mar 2018 00:08:37 -0800 (PST) X-Google-Smtp-Source: AG47ELttTTTdLAAtHeyWGERDGxOzZ03dyMTPTctWZ1LDwF1t2RgYeAnq0Fj2Omib7lj1hdZlE1xW X-Received: by 10.98.31.79 with SMTP id f76mr29279593pff.60.1520582917403; Fri, 09 Mar 2018 00:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520582917; cv=none; d=google.com; s=arc-20160816; b=0g2Xsc4OC6lDJv26TGWnPEu6Z5+ZcIpP8QdJIajYONDLvO1udkIrTO7zkbwRfPGMfn puRuSR3D+FeRhLYlh6xhQ2PZUZms1eh+6/WE/KDlasX6drjCrYB5VWUKVd3HGRBuVvNh KdGq3D5ZbtzErqv6UAxCXhLxxkbyDrdr+v1n5SMwnwBYOVktzPYImskEgAvDkUty2fnm uc8aFxP2n6MpJ6MZs/0myumEzoVK3nRCEJqZpGQXJKkeZMAxamYtMJK1FzV9hsr2NDr/ EfjjrcP72XPyjNuA9OSySeEnWDyGjhgXCsBz1cRsR9AJqlNduKEP2Sniia5fDeoQFX0a gNEA== 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=cu1jxLK6cwq/hNI6inpMVXH5L8thzupifdRHaNfXR1o=; b=HyfTGSNlk7IXjxdbOnyc66O6kqfWLJmecpZx6fpM3HMMcrS0LEbxi2W90/uhsy4hTh 8l6WPs0xSlBbCMiVGdipV/bkWvORpHPBUPLlkgRxVbxB74mYz91PTjqUoAlxpE/ckiyE UK4ZXUcX9MIZcxVCkQwWWNJFIF5vpd4EM2x8wkOU3GOddpM1uPNndOjuuv4WMgmNiyak LWEd0Zi8PGPKIiFq9nANN64Rzfn2WEISrUrkDNexlyycxugXUs2dgRoP3fgcWNvv+B5O QZvgDiYDzQ9dMaWvXZewmNh6oA/9tB0quNvsI9xyv1z1YvZHUjyi/onvJbUX6MgWsVXi lLnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eDPn5j+S; 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 61-v6si460752plz.507.2018.03.09.00.08.22; Fri, 09 Mar 2018 00:08:37 -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=eDPn5j+S; 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 S1751564AbeCIIHN (ORCPT + 99 others); Fri, 9 Mar 2018 03:07:13 -0500 Received: from mail-io0-f173.google.com ([209.85.223.173]:36592 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926AbeCIIHM (ORCPT ); Fri, 9 Mar 2018 03:07:12 -0500 Received: by mail-io0-f173.google.com with SMTP id e30so2672749ioc.3 for ; Fri, 09 Mar 2018 00:07:12 -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=cu1jxLK6cwq/hNI6inpMVXH5L8thzupifdRHaNfXR1o=; b=eDPn5j+SloCpQljjsTDClw8sq8XL/WKnsgIDz5Q8PHbuNxoD9yD0uSmZCTOJ5e5uOq K/vQ9Jel2SM4FKyK3OsWeGNxUjIqZoPyjiHfnH7ul8F4B46mnfaUyPlTyeEL/1u7Wo8R 3EvknInCQcOSBR6HPDXaXH9UwAk+rPzSdqCmM= 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=cu1jxLK6cwq/hNI6inpMVXH5L8thzupifdRHaNfXR1o=; b=g5X8HXQfkiFUSRR6hfX4ZjHC4om7ToxxocOmDESZ/9UOh+9Qx5qpUBo4kBXfj2v8RW 35IpcXqmlwCnWrQPhMarJsjEwxcukPMhgAqnm1r+HJZ6fRNF8vg4/PPaDmTHZ6kWkNpw d4grZFi4l3e30PLZ6EC/lqOTf5/fNBtxEBMVq/1mV2BleurdkKk5cOqUwQbeGCMtZioS zDZk2h3yRU+WudwUzTDStOh5hoFOOGEthJUexGZeZPG4UNYaWNx0ksS2CmzXdPlEVVLM 0+k/yIzdxv+GgzaDiAkUWHyDMRvLbX7NIqQFHgDEusZb5Q5R8Y99AtDia8cVpK6jcKkf 0ApQ== X-Gm-Message-State: APf1xPAWDRclETSJeVVqz2kanFI3IBSGGrJFWu6RgXjrEfqdYwEa/8iP nx6kfp7p12Z3qEmorJDWLzstIj9ZJHDDsBMsXORkxA== X-Received: by 10.107.5.199 with SMTP id 190mr36070228iof.107.1520582831682; Fri, 09 Mar 2018 00:07:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Fri, 9 Mar 2018 00:07:11 -0800 (PST) In-Reply-To: <20180309080428.atur6wcbb6vtonhz@gmail.com> 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:07:11 +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: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.