Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp265342ybe; Mon, 2 Sep 2019 00:56:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwd+r12AaU3l+eui+jnVLp8BQqbdZCkxsVh/pz09+OF09TPfjgAVrqh+MwRXqEvcl1rB0nX X-Received: by 2002:a17:902:848c:: with SMTP id c12mr28525948plo.47.1567411008151; Mon, 02 Sep 2019 00:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567411008; cv=none; d=google.com; s=arc-20160816; b=oFcSQiwPrBXizn44Pg10SC+EYCzvmwlaswN7iO9Owea8BzenC4NkyrAFAfC9sVEXwv ayyfsAcOe0Q1sRLuNupUDeXHqza7NsGIDre+eZ7brBC7YcT4zD12h3Au6uhOjOMN75fy sqbBceULg+UXre+LVtq93Ke9S9Ogu4qJkUspvJOkcFA/5nrCaidVcbYk0rHaxBAFLyqR I/dSfB+HF98XKhbk4KfYVE4PRv1kiJqACHyldeDsPvXVv/tvDTcAb4I2RlljXvIZjSEQ eR3/LCOc+OS5h250iGMr7FwNSWxNcilBlPC4pL3tEC8KIp6syL+RCdZWAFh/iu0WJzu8 0pig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6QsD+AHu1Yno8XQTFV9mVYOOP5Nj/k9yyfN0Iim7F+w=; b=IlVU3BMCQHuP4JeEgfi4zZdzYHi6yiWj6a8ZmtT14d/eF1QwIqr6TxSH1ATkcY1PbO jSMNc3/znYNjeTh3QDgCXIWfUySqJYc+yUwvN18y4NPnaRdWl+NSPYgTLOu1Ll/UM/Xf DQtgeL3TDh7C/Wqalre0e5HFAt5iDa7iEmeSDjrnHzFfhWZH13a3IPmtCaFCHsRanp8B 3UMVQgnJ+dznjIQ1K+Ofq0EweMEuHmCcmuv+4L+TQrbeVrOKWJ0ehyuCd/J3V+uGWunF qzCJgZiTiuPZgGQvUkofizL+Hqglc7TIAKaxQoJUtP1a6e5oHpKySsAUHiTWxDigpmPy WCCA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v24si11055770plo.244.2019.09.02.00.56.32; Mon, 02 Sep 2019 00:56:48 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729875AbfIBHyR (ORCPT + 99 others); Mon, 2 Sep 2019 03:54:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:46806 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729606AbfIBHyR (ORCPT ); Mon, 2 Sep 2019 03:54:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5326BAFBE; Mon, 2 Sep 2019 07:54:16 +0000 (UTC) Subject: Re: [Xen-devel] [PATCH] x86/xen/efi: Fix EFI variable 'name' type conversion To: Adam Zerella Cc: Borislav Petkov , Stefano Stabellini , x86@kernel.org, Thomas Gleixner , xen-devel@lists.xenproject.org, Boris Ostrovsky , Ingo Molnar , Juergen Gross , linux-kernel@vger.kernel.org, "H. Peter Anvin" References: <20190901065828.7762-1-adam.zerella@gmail.com> From: Jan Beulich Message-ID: <84ce8eca-b02a-de32-2e1b-a0bf3542c674@suse.com> Date: Mon, 2 Sep 2019 09:54:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190901065828.7762-1-adam.zerella@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.09.2019 08:58, Adam Zerella wrote: > This resolves a type conversion from 'char *' to 'unsigned short'. Could you explain this? There's no ... > --- a/arch/x86/xen/efi.c > +++ b/arch/x86/xen/efi.c > @@ -118,8 +118,8 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void) > unsigned long size; > > size = sizeof(secboot); > - status = efi.get_variable(L"SecureBoot", &efi_variable_guid, > - NULL, &size, &secboot); > + status = efi.get_variable((efi_char16_t *)L"SecureBoot", > + &efi_variable_guid, NULL, &size, &secboot); ... "char *" resulting as type for L"" type strings, hence there should be no need for a cast: In fact I consider such casts dangerous, as they may hide actual problems. To me this looks more like something that wants fixing in sparse; the compilers, after all, have no issue with such wide character string literals. > @@ -158,7 +158,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void) > return efi_secureboot_mode_unknown; > } > > -void __init xen_efi_init(struct boot_params *boot_params) > +static void __init xen_efi_init(struct boot_params *boot_params) > { > efi_system_table_t *efi_systab_xen; If I was a maintainer of this code, I'd request this not be part of a patch with a title being entirely unrelated to the change. Jan