Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4092377iob; Sun, 8 May 2022 03:01:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgw4M8x1dXdPtjhPTCxctiglAKb9/0HxQCJxqB5giA4+IYERAt9EHfh80EdgJdXCgpBc9y X-Received: by 2002:a17:907:6ea2:b0:6f9:5408:2153 with SMTP id sh34-20020a1709076ea200b006f954082153mr3048805ejc.335.1652004079122; Sun, 08 May 2022 03:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652004079; cv=none; d=google.com; s=arc-20160816; b=vAP/hAbz9TwcxANMwOrKWYYKMZmSlAt5oQykRFocOpukOH1ZkGHu7nP356LwhIXEGL iXec7Q9nS+9zGs2Z0SZ/unIerFC2RHY6u9JZLgHrIxR6nCVx0HBaby2EpYA4I/ddJUGY I8k8+hQfmJwJt1wGkZaHqXMKJMjlTqXYsSgbVSeceXL8bd4pks724XPuuMMA1IJNP+wE s4wiKbGmhtbXmLA3jfdz4pQSCaTUP1rAxVsj9Fw1zlqIiPnAWhR+3xTddjINSHNuchYc f6HKg3BzZBYhjhnm9anJOmtKpteMf6AwKQMOcuE3kkMfPnqk1rqQilAngLKq+MkvgjO/ 41Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=GAbuBCichvwfzdNdxCXZTtJ8ed6pIg+wrMbg9Pyq58E=; b=QW5bfHqkq5QiLSxF/sf/ouS/X4bkUO7+xKAyvnN5k4sx/yTlo8y82RGmzQBKcN+lPB HwQTGqPM2Ap5QNQZbInkPk6wsDJ+8sH9jLjaNeiA1L+FNyB3TQZ6IN/XwMBkD/N+/Zq0 Ay1K1xbEWuy4u857mHLly79H91YxIFLQvuUqMP1wkMFqRgtiy/YXcUlFlP7rfaXYIGC/ GCCitf3OtAZv0qL7yYoppBMR/u/rC+6vEU6q5/iWlzV0FCEfUSggn8H0Ipa7fJgTmDSr GpVCZvVAu/Xev+fALlSgnjkWPBdslgiVcA4M8CrqaW5A+DYro6SqDHsyeuXZylydQVi4 4ZZw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds10-20020a170907724a00b006e840a5c05csi2110682ejc.918.2022.05.08.03.00.51; Sun, 08 May 2022 03:01:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355512AbiEENlk (ORCPT + 99 others); Thu, 5 May 2022 09:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbiEENlh (ORCPT ); Thu, 5 May 2022 09:41:37 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 556B756C03; Thu, 5 May 2022 06:37:56 -0700 (PDT) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nmbfl-0006wu-8K; Thu, 05 May 2022 15:37:37 +0200 Message-ID: Date: Thu, 5 May 2022 15:37:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] x86: Function missing integer return value Content-Language: en-US To: Juergen Gross , Li kunyu Cc: x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, seanjc@google.com References: <20220505113218.93520-1-kunyu@nfschina.com> From: "Maciej S. Szmigiero" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 5.05.2022 13:36, Juergen Gross wrote: > On 05.05.22 13:32, Li kunyu wrote: >> This function may need to return a value >> >> Signed-off-by: Li kunyu >> --- >>   arch/x86/kvm/mmu/mmu.c | 2 ++ >>   1 file changed, 2 insertions(+) >> >> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c >> index 64a2a7e2be90..68f33b932f94 100644 >> --- a/arch/x86/kvm/mmu/mmu.c >> +++ b/arch/x86/kvm/mmu/mmu.c >> @@ -6500,6 +6500,8 @@ static int kvm_nx_lpage_recovery_worker(struct kvm *kvm, uintptr_t data) >>           kvm_recover_nx_lpages(kvm); >>       } >> + >> +    return 0; > > This statement is not reachable, so the patch is adding unneeded dead > code only. Maybe some static checker isn't smart enough to figure this out. In this case it would probably be better to also change: > if (kthread_should_stop()) > return 0; into: > if (kthread_should_stop()) > break; so the newly introduced code isn't dead. > Juergen Thanks, Maciej