Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2720203rwb; Mon, 19 Sep 2022 09:01:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56BdG+tYU57QKSRfJKXxKb1AsAgnQgv3z1CGKCZI/pKJXRIOGJrgx5GkE3CHIGK9uXlRqZ X-Received: by 2002:a17:903:1110:b0:178:9f67:b524 with SMTP id n16-20020a170903111000b001789f67b524mr466923plh.50.1663603297609; Mon, 19 Sep 2022 09:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663603297; cv=none; d=google.com; s=arc-20160816; b=HqFPWK1LBocVz971gZdlFNfZJ0OqidGzkbCFwyLzfUb3U4XIkSr7kk1/zt7A5UJE10 wD7BA7C9ay0OfIjRTp9RDECYf7cB6IKN8tyb9cS/86ewTRxKgYvBAv6Xhrdy7SIUBQBg NgCSpRzxDk6xCeOLtaEb7GuZeBKxCIKRO1zP0eVKPg/X0f509dGSmIu7Vr54zLj6yVgC nfLe8rVF52wg4rvJHGCVtc1pfnJrce5PVMxHHbY9YE30kebYNVohUDIT/dacW+LqbJpj d2QzmrYQwFEQ6UIHQehD/GJARiGzsVWuTf5X57KeAYH/xgoEKyl5PF7I1XOHJfgnqoxu SiVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=CWg8VC3Y2I+R8H0oWyV4jcW6qd/ETEFixpJMwEeGBEQ=; b=F72ORQvrLSzCOKDTGzUP3FKIT0LEAi0J0xYxm1ufDbucWfzXGdytjKrUXSFaaf9l4G pqeHDfbXUjx5Qb6cp8VSyvabepZTp4PCALsQGgZ8Hp3o80fAiI2Af+lzfnFlMhNvfrMy Sp2mDKLOlzfhFivPlC5adWsjR95l3vpqkAJA0wC7qp9id/KiNFa3a6g0S637kbgFFl7K YIcaAwNlw1LWdqmmnZQhkiQ7psaahycRC1wDJ8dz+S3g4DALLm4Ye2jZuo6VYWFtTLRm PpH3Z/Q8ni/j44NJfRITkhkwzajiqno+/rCjrVZj3lLTDyD1Oq7xMmyea+bijwNOHdBa oYkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Cik/Dxkw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a170903024600b00176a16ca9b1si33249336plh.529.2022.09.19.09.01.25; Mon, 19 Sep 2022 09:01:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Cik/Dxkw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229521AbiISPdY (ORCPT + 99 others); Mon, 19 Sep 2022 11:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiISPdW (ORCPT ); Mon, 19 Sep 2022 11:33:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 498D027CFE for ; Mon, 19 Sep 2022 08:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663601600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CWg8VC3Y2I+R8H0oWyV4jcW6qd/ETEFixpJMwEeGBEQ=; b=Cik/DxkwJogEzAuoLfU6MONRlxrWldD0qcCfDRQSv8/7PVXbye7QQSsVq0YyEz51hhMZPo 0T3V14/INni4ydQ2Izs3W4bZwMlMj6fZR/VfQp9YtKmm8GU9JWVaYgcywKyv8ytBxusE3s do1S5Gw0Y6gB3McYmKMyiNAf39/n628= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-204-msM-9R_9McOA2gR6aDI5Hw-1; Mon, 19 Sep 2022 11:33:18 -0400 X-MC-Unique: msM-9R_9McOA2gR6aDI5Hw-1 Received: by mail-ej1-f71.google.com with SMTP id sb32-20020a1709076da000b0077faea20701so7791576ejc.10 for ; Mon, 19 Sep 2022 08:33:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=CWg8VC3Y2I+R8H0oWyV4jcW6qd/ETEFixpJMwEeGBEQ=; b=fDUu05Ym4xi5ZfrDg0+d8+XkPiMi7BLJtSOMUpdyntBBU6pA07uS6EySGfSEGFtLkJ 6ezBQxtA+2rCSTOAGecmODBWTTJWeSvyJ1p1dmg30Ugg/a5U4fdAGPBlwRFhvAnBj2t+ Bnqt0A2UnK6g2ww4tEBwzd5aek/cXKT0RGmZEnET338ikB+BWgB4q9Fedv5D2GdoSjOa VG3Mdb1J/cQJYkDCzErFprPDxlNYxa9lVqhN50wS0RsfcAEc8yiEOy28GGMXo6pJFKPe x/t/TZMhJqfHNotoU4yLhLt94J/bYI1WJzB43MHQM6wP4+w2ODqOZWwfzJAIl/VwQhmK M6GA== X-Gm-Message-State: ACrzQf1veslV35SbN/YlLeOJ1LcdaEDlhgEm/pERwripJnfbCsz+GOym olxMrM1yfSZ3/zFoia4tDa3zjbWHDAl19mekNEZhT5hqbWL7nggjFH1jlM7TrJsrLCmEeHkdje4 nyAC9uwxCNdhPhmnC29hSXrzS X-Received: by 2002:a17:906:8a52:b0:781:7aa7:9dde with SMTP id gx18-20020a1709068a5200b007817aa79ddemr2059398ejc.70.1663601597740; Mon, 19 Sep 2022 08:33:17 -0700 (PDT) X-Received: by 2002:a17:906:8a52:b0:781:7aa7:9dde with SMTP id gx18-20020a1709068a5200b007817aa79ddemr2059386ejc.70.1663601597530; Mon, 19 Sep 2022 08:33:17 -0700 (PDT) Received: from fedora (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id e7-20020a170906314700b007708130c287sm15627839eje.40.2022.09.19.08.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 08:33:16 -0700 (PDT) From: Vitaly Kuznetsov To: Li zeming Cc: linux-hyperv@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming , kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org Subject: Re: [PATCH] asm-generic: Remove unnecessary =?utf-8?B?4oCYMA==?= =?utf-8?B?4oCZ?= values from guest_id In-Reply-To: <20220919015136.3409-1-zeming@nfschina.com> References: <20220919015136.3409-1-zeming@nfschina.com> Date: Mon, 19 Sep 2022 17:33:15 +0200 Message-ID: <878rmfpef8.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Li zeming writes: > The file variable is assigned guest_id, it does not need to be initialized. > > Signed-off-by: Li zeming > --- > include/asm-generic/mshyperv.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h > index c05d2ce9b6cd..cd5ce86c218a 100644 > --- a/include/asm-generic/mshyperv.h > +++ b/include/asm-generic/mshyperv.h > @@ -108,7 +108,7 @@ static inline u64 hv_do_rep_hypercall(u16 code, u16 rep_count, u16 varhead_size, > static inline __u64 generate_guest_id(__u64 d_info1, __u64 kernel_version, > __u64 d_info2) > { > - __u64 guest_id = 0; > + __u64 guest_id; > > guest_id = (((__u64)HV_LINUX_VENDOR_ID) << 48); > guest_id |= (d_info1 << 48); The initializer is certainly not needed, however, if we are to do some changes, let's be bold. Suggestions: 1) Stop using "__u64" type, "u64" is good enough. 2) Drop all the parameters from the function, both call sites look like generate_guest_id(0, LINUX_VERSION_CODE, 0); 3) Rename the function to make it clear it's Hyper-V related, e.g. "hv_generate_guest_id()". ... -- Vitaly