Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp426947rdb; Mon, 18 Sep 2023 22:19:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyuLRIlqyWqVErpUfSBuOgimGUqPT2VigC1lzUTZtHFdBmAgPqyMdFxGtdc2IJMNEBORH2 X-Received: by 2002:a05:620a:b54:b0:76f:2214:e2c3 with SMTP id x20-20020a05620a0b5400b0076f2214e2c3mr10061028qkg.64.1695100757105; Mon, 18 Sep 2023 22:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695100757; cv=none; d=google.com; s=arc-20160816; b=Rnnpy8SgvfggoQN6Z1e5HH9ZgUEtvVi8WmYIeD8BujCUeIGxakkjZ2puVywMgs/UtF VYPL5iQKkAe54GiLcujRvT7rQraKX5wcqE8wdD8GDMebqxsq221pcysSwVKIkJPP7cyR DSKqABBWhmu+4gYhsw3LjrvX3QBQ3YQFUWu0NoQPq9k7vDWIpGScJs0G6kxi6LzNfqP/ Dz+Fa6Sj1jgmrAgx1UxPPgHVSLCIJE2UTezl5AQa2YbkEvoJkPo+Qo0uq46GiBNsJxkv JMKlpz3nU7+X7ycdQ+xLZvBNb5Cy6tfNYnNT6IH6FHXXiYKzm8KRH0qNSA1fSBE1lfu4 tf6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=e2Mo/JogS2r4yVIJ4P9KEe5WbLNZI6sRDnlhku9ywsI=; fh=PF8+caV194k1OhDR/cm0SiO+gl7nM+ikS+643eVPeOk=; b=A18dlRkJcLqj4XZcumN0IPNzemVV6uCwGm0QA5wGPm2DZB2yuWyW4ONizGSbMuKMU9 kIP9EZJwxHqeu2aI3xo5Y60EtycfkupcUzzRFb8v3tY3IECwCWwUUtVBO2J3JIt7MbEW kO8kL737QafXoHBFW5R8l1PaBZIxUk9PVAS7GjxS2a+SJkmZzCzHu955zaPXZ4/tSc70 4G1KJ7dxPMJ9hOt7kxyuvi9rq9M9L6CK4nEWNOJ3YEZWOVFVonH1MihmGUFtWuIXzJTk puH1A25i5EN9IDxkwU/6KOj/vdVXlfrVf1AYChEbDHmvRBCSLbbWjm+lOrmmSnkrM6YW MAOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QWdbjsk/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b6-20020a63d806000000b0056fa1bc208esi8853190pgh.722.2023.09.18.22.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 22:19:17 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QWdbjsk/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B1B568330E8C; Mon, 18 Sep 2023 22:19:15 -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 S231186AbjISFTQ (ORCPT + 99 others); Tue, 19 Sep 2023 01:19:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbjISFTP (ORCPT ); Tue, 19 Sep 2023 01:19:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C6B9FC; Mon, 18 Sep 2023 22:19:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DDA4C433C8; Tue, 19 Sep 2023 05:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695100749; bh=b0mnAPtySR6jZ3NDA8RYGRddFtYNQZ0xvMRTcjIL/x8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QWdbjsk/12RUMkBwU5i21Amo060j/pmAEnP3P3V2hqJi4laTnXXGvid1+xL7PxOZp f+3SIONUh/tXxgcHrYCYEkcn/aURAmqHj2IXyDyRJT2sCtQUlBR+GOichZMz1CZoGv LB5sHYsCi8ZD07VMzHhJNiIwA0MNr0/6JmE1uAxJDZYDbwv/Utigl5i4SOI93I9SZN pVaA1Hkxny3dS+IdfLGKH/fybdt9H3Moi7Qv3AGRGoKSLEF06/T1ps0GKr4X9Kakwz BgUqvyyuppVwDx0UJumn1jFqjWSNns4Rn6x1FIU+ZdyLJEPiaFpnqKv9bMeU3Wtl51 K9YBAeWUA9N3A== Date: Tue, 19 Sep 2023 14:19:04 +0900 From: Masami Hiramatsu (Google) To: Li zeming Cc: naveen.n.rao@linux.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH] kprobes: Remove unnecessary initial values of variables Message-Id: <20230919141904.ef53e6663e4c5400ae913622@kernel.org> In-Reply-To: <20230919012823.7815-1-zeming@nfschina.com> References: <20230919012823.7815-1-zeming@nfschina.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 22:19:16 -0700 (PDT) On Tue, 19 Sep 2023 09:28:23 +0800 Li zeming wrote: > ri and sym is assigned first, so it does not need to initialize the > assignment. > Yes, thanks for fixing! Acked-by: Masami Hiramatsu (Google) > Signed-off-by: Li zeming > --- > kernel/kprobes.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > index ca385b61d546..82b2a366d496 100644 > --- a/kernel/kprobes.c > +++ b/kernel/kprobes.c > @@ -1990,7 +1990,7 @@ NOKPROBE_SYMBOL(__kretprobe_find_ret_addr); > unsigned long kretprobe_find_ret_addr(struct task_struct *tsk, void *fp, > struct llist_node **cur) > { > - struct kretprobe_instance *ri = NULL; > + struct kretprobe_instance *ri; > kprobe_opcode_t *ret; > > if (WARN_ON_ONCE(!cur)) > @@ -2817,7 +2817,7 @@ static int show_kprobe_addr(struct seq_file *pi, void *v) > { > struct hlist_head *head; > struct kprobe *p, *kp; > - const char *sym = NULL; > + const char *sym; > unsigned int i = *(loff_t *) v; > unsigned long offset = 0; > char *modname, namebuf[KSYM_NAME_LEN]; > -- > 2.18.2 > -- Masami Hiramatsu (Google)