Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3053476rdg; Tue, 17 Oct 2023 03:15:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiTPeiQ/RkmFvRU6ZXxJm0x8KSRpjuNGik2exRmhyo5h3vb8z3DYuXnAi4AiUvk6O13CNA X-Received: by 2002:a92:c267:0:b0:351:2288:e132 with SMTP id h7-20020a92c267000000b003512288e132mr2413582ild.21.1697537703942; Tue, 17 Oct 2023 03:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697537703; cv=none; d=google.com; s=arc-20160816; b=uKukrMT+plfua1gboRphqEzGEQdzxnZxNmTNCkRmpSZtJ7uSjK/nGohg7JsFOsAflI HzMlFJH6MCMRWD9owEUyckRjrmnFXgjtZWlfcAa/Oyc0db270p8h48AY5skekp/Tt7xs qPuKHNDgD5JgkI8iscklunCu+2K3f2aFP5Sl3zFUWgAne3oY7x3h2eryBqZEBey9t5KC hsRJtmtO3sAPLk+b9+r3g7g29MlUCJellJuxHcsQFrExcJvys5Dau5FQwvSPFLwwOBni CNbYS3DokIDELc+hRaAzBjFSkNoaOZdscUZeOe4SaQ5vQi4RSiybf0KgbaUKCfKXTDuC p9Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=7KzRyEDb3Yl3uqSVFwzlVBcvmR8L95UVrB/144OLbis=; fh=+USKBU0UoW0g+D1jF1T+DaTjdwR7iEqmfMIhi3DiiGs=; b=NW8Yj+/+HVdUTqyDtP5mc2y7SgLoQocQ8Cx36cQo7+eEtl5jpe4RKgV/JeYnWsIoUr qHcLqoq8oGJzgr5+FdrK2UgVqy0/+2ylnOt7O/BnUJJ/w+fAHuAlczT+b5Q0/EbiHmaG SJv9DUreTLIu4GGOg9z/6V7rBIBasioaFEZFcvCKLfzbp3dpqbPx7BL7S0WdAVe3DOne FEkRteGvMYQEMyLIRxCrWqvVD5/kqEOFGZx0tHeuB18P/das0O7cIXGurCzoE2ZGJrU+ RPUv+cYSyqFbULOyz1L5KusTnWTmWxJgUFx57OLch2ldB1PobOksMVmF0dSwAbI0WS0y TAzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b14-20020a63714e000000b005ad176a9d2bsi1351745pgn.240.2023.10.17.03.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 03:15:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6E4BB803B2F3; Tue, 17 Oct 2023 03:15:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343512AbjJQKOy (ORCPT + 99 others); Tue, 17 Oct 2023 06:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234791AbjJQKOx (ORCPT ); Tue, 17 Oct 2023 06:14:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 343A78E for ; Tue, 17 Oct 2023 03:14:51 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 42ABC2F4; Tue, 17 Oct 2023 03:15:31 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.68.232]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C1F933F762; Tue, 17 Oct 2023 03:14:49 -0700 (PDT) Date: Tue, 17 Oct 2023 11:14:43 +0100 From: Mark Rutland To: Li zeming Cc: gor@linux.ibm.com, hca@linux.ibm.com, linux-kernel@vger.kernel.org, Kees Cook Subject: Re: [PATCH] stackleak: =?us-ascii?Q?Remove?= =?us-ascii?Q?_unnecessary_'0'?= values from ret Message-ID: References: <20231017060824.10434-1-zeming@nfschina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231017060824.10434-1-zeming@nfschina.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 03:15:01 -0700 (PDT) On Tue, Oct 17, 2023 at 02:08:24PM +0800, Li zeming wrote: > ret is assigned first, so it does not need to initialize the assignment. > > Signed-off-by: Li zeming Does this actually need to change? It's not harmful, and deleting the assignment doesn't save any lines of code. That said, I don't have strong feelings either way, and Kees is the de-facto-yet-undocumented maintainer for this code, so I will leave it to him to decide whether to apply. Mark. > --- > kernel/stackleak.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/stackleak.c b/kernel/stackleak.c > index 34c9d81eea940..3faf863593846 100644 > --- a/kernel/stackleak.c > +++ b/kernel/stackleak.c > @@ -24,7 +24,7 @@ static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass); > static int stack_erasing_sysctl(struct ctl_table *table, int write, > void __user *buffer, size_t *lenp, loff_t *ppos) > { > - int ret = 0; > + int ret; > int state = !static_branch_unlikely(&stack_erasing_bypass); > int prev_state = state; > > -- > 2.18.2 >