From patchwork Tue Sep 19 01:28:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 141644 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3065626vqi; Mon, 18 Sep 2023 18:29:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzEkjpBLlM9dHW0MJQjP1p5JAxD3pIsODIXyTKkKeton1+aNncB/oWaYRVkZHeNmSq4pBZ X-Received: by 2002:a05:6a00:2d1a:b0:690:38b6:b2db with SMTP id fa26-20020a056a002d1a00b0069038b6b2dbmr12459065pfb.6.1695086948360; Mon, 18 Sep 2023 18:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695086948; cv=none; d=google.com; s=arc-20160816; b=c2CVkUwlmc0smPs1FdcYTIGSmnTqjM2PdUK9Dukgf7KXl4iN6RQMC0H5FbhF+xSjCm 5o8zo71lxfP9eih17+U1vtCJA6cAS7KTovmooVey8ojduY/iuKPO1ph85xDmVXaSRZBH wG4v+BLz2y7tvJWW0k28pJVQfhicd4HSZB3BLqZNpp3toXqTBlgqKkbEdrUr1xdlIWth /CMQlJ9Fz/IHf2s586iohnpYbz3ajrPxVqBaO3mJDfsmph7cgy5BBU1d5nz3FrxN1lrm /B/zqTQMf3L4oDwmVs//BnWZiyx2yn924BMB44oRHFbuS/4k4UpPhuJ2nPbld8OvFN6G fMKg== 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 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cn15-20020a056a00340f00b0069015b1491bsi8876302pfb.120.2023.09.18.18.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 18:29:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id BB5008339648; Mon, 18 Sep 2023 18:29:07 -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 S230442AbjISB3I (ORCPT + 26 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 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 18:29:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777427491899145825 X-GMAIL-MSGID: 1777427491899145825 ri and sym is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming Acked-by: Masami Hiramatsu (Google) --- 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];