Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp355922rdb; Mon, 18 Sep 2023 18:29:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/ppTiXN8maOLOHfH572btmtBfvzm0nyqCLbEVtwAoDusXRjWE1rXzHGLkrtnLDS5GR+pb X-Received: by 2002:a05:6a00:39a5:b0:682:4c1c:a0fc with SMTP id fi37-20020a056a0039a500b006824c1ca0fcmr12940636pfb.19.1695086946737; Mon, 18 Sep 2023 18:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695086946; cv=none; d=google.com; s=arc-20160816; b=bcfIpcIqMCfqZxpZvi39NdpRZOnp1dMTlCRn21g9OzR7wrIron77BppcTTjkAr7K+1 tSj0PrM7+I/g5qI6kdS5Lu/OwbKMyauD0z/O4HX5BxSfMIdoWkicxSHWzAxzSv7kx3VA vflre8g1DqXpP1yST8bNSFVilFd825gXzXbFrLOCT5RSuc56nOmgupnSXJMV9ZGMZoHZ arGUmfJxiTU6n/29RW7ydiqwn9/t30PtOFxF72IjeKAPcsy6VtxjacYkEBzcUg4FQNRm keebnb1xYyvQAryfiyxRHpijVhqn88Vu4qgBPuxP2kmdnS2vuI04G6aGuTi83YhV/uum buYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=cKsWwIvoqB7dZQ0hliJM3adw8/kx7GmXTUyf2Ge2vgg=; fh=MDcLyW7gnQ7zhVrwu4ydSY34K8iXsxgpLnkzEl2cuwA=; b=XmvH7sd3eyPdKd1rAdmOmMriQZfAqPDCLVXqr2l1jyXQfmP1AnGjYTJSs6xAs6H52l hbOax4fTXTNdpL0zB0721epSDlnEDH3oh9GzI7Ac6dC/jPqmk1Iw1wWqYB/oasirLOxt HPV0ER6cszyXK7ussON1JIM3/ARGH9A5BPkuu+wmF65QfbX2MEDkve02TL8Jt+CD6jze Mm6t1rPzhgZhy6X+qXN7tpIyYFKAmZUT+aLF15q2HFrbijZQ4QRgQdSetGnktNgTIB72 Fe6s0CWVDTOpnMlUa2LGnsazp2Y0T0VRiyLdz2fgvUSs8TYiMZtwm6YmbhgjkGGGuPsG e01w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bz3-20020a056a02060300b00565f182839asi9560148pgb.28.2023.09.18.18.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 18:29:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B162481B8036; Mon, 18 Sep 2023 18:29:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230439AbjISB3I (ORCPT + 99 others); Mon, 18 Sep 2023 21:29:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjISB3H (ORCPT ); Mon, 18 Sep 2023 21:29:07 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 00CEA106; Mon, 18 Sep 2023 18:29:00 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id C859660284275; Tue, 19 Sep 2023 09:28:40 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: naveen.n.rao@linux.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, mhiramat@kernel.org Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Li zeming Subject: [PATCH] kprobes: Remove unnecessary initial values of variables Date: Tue, 19 Sep 2023 09:28:23 +0800 Message-Id: <20230919012823.7815-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no 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 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 18:29:06 -0700 (PDT) ri and sym is assigned first, so it does not need to initialize the assignment. 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