Message ID | 20221115015508.3054-1-zeming@nfschina.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2469950wru; Mon, 14 Nov 2022 18:03:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gQksxVCvavRv/J/XWkSmYYukxVlxIo8RnMmBd7i3BkyXvlpf/sol0pCMhLsDW8WX0pdRe X-Received: by 2002:a17:907:7889:b0:78e:11ea:8528 with SMTP id ku9-20020a170907788900b0078e11ea8528mr12246494ejc.190.1668477803039; Mon, 14 Nov 2022 18:03:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668477803; cv=none; d=google.com; s=arc-20160816; b=S8QP3D4Qt/xNBj2nDWCBiOUCubZ81KDKx2OElK/QgA/qVbI+hDO1Er/Y/dZmv0KT6z 5ypbfh2Dm+F0+0Bo2QeA81UcYhcpqS2ImeovmUPbGFKHfBWya5Dd5ZE42c/XZyFf5zRl WOPDynEbPQkU37W5fcyxHl9jS54dE0BXvI5Jr30dWaIo6wp7BEDk8mbS8wRufyv7Q9bn 0X0/7UtaPHAjUpqFLQz64xt0ZFIN3pGdeQ6/iMzflQy+MfTuB3wzESlQw7B/i7ibmrxq J1RSk1EwaWMZkRzODULmJAZ9mJEx0nhSzqzZRr2S6aqbpnjsSTGa155DeKVZFUqq21cV yNXQ== 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 :message-id:date:subject:cc:to:from; bh=qC3g5ikpq+mBZM/VTqZWi27RH6anKrnDhkGv0oG2sEY=; b=DC9i2EPLA1vlBjmBR7YImhIrQBkmWQB3bmEmHrT3PclfPwMWgS1d5uKGIaC9Uqp9dr IBx5hI3A6dyTRSDW4YQGDDtkN4i7mRyY7cbng78Rx9eDX5lC9S3ufJhHTGhIPTBTNHqW UQ9b0XTgJ0MPLgH5kRPsUSLWYBc9gICNdAHVA5C7zlH2GAQt9PdRgR0VzrPUCVVElcBC 1gPp139P18ItsRvAXMB0cY/3+Pgg1MunNDI4beBVbHFkWAz2d6II2dPlJERt4MZUDP+x OYoffKqSy2r6DM6ncI3gyRhU28+5lFJzM5Vk+Ya/+ScTgZsZhapBRrzCQIg5xFrIaht/ fGyg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg4-20020a1709072cc400b007918f58458bsi10167524ejc.441.2022.11.14.18.02.59; Mon, 14 Nov 2022 18:03:23 -0800 (PST) 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 S232295AbiKOBzf (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 14 Nov 2022 20:55:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231589AbiKOBzd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 20:55:33 -0500 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F07717421; Mon, 14 Nov 2022 17:55:32 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id C69E61E80DC8; Tue, 15 Nov 2022 09:52:33 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tyl9YcZ3otWi; Tue, 15 Nov 2022 09:52:28 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 5C2F91E80DC6; Tue, 15 Nov 2022 09:52:28 +0800 (CST) From: Li zeming <zeming@nfschina.com> To: vyasevich@gmail.com, nhorman@tuxdriver.com, marcelo.leitner@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming <zeming@nfschina.com> Subject: [PATCH] =?utf-8?q?sctp=3A_sm=5Fstatefuns=3A_Remove_unnecessary_?= =?utf-8?q?=E2=80=98NULL=E2=80=99_values_from_Pointer?= Date: Tue, 15 Nov 2022 09:55:08 +0800 Message-Id: <20221115015508.3054-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749525780826521297?= X-GMAIL-MSGID: =?utf-8?q?1749525780826521297?= |
Series |
sctp: sm_statefuns: Remove unnecessary ‘NULL’ values from Pointer
|
|
Commit Message
Li zeming
Nov. 15, 2022, 1:55 a.m. UTC
The packet pointer is assigned first. It does not need to initialize the
assignment.
Signed-off-by: Li zeming <zeming@nfschina.com>
---
net/sctp/sm_statefuns.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, On Tue, 2022-11-15 at 09:55 +0800, Li zeming wrote: > The packet pointer is assigned first. It does not need to initialize the > assignment. > > Signed-off-by: Li zeming <zeming@nfschina.com> I'm sorry, but IMHO the commit message is quite unclear, I suggest to re-phrase to something alike: """ The 'packet' pointer is always set in the later code, no need to initialize it at definition time. """ Thanks, Paolo
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index f6ee7f4040c1..714605746fee 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -3781,7 +3781,7 @@ static enum sctp_disposition sctp_sf_shut_8_4_5( void *arg, struct sctp_cmd_seq *commands) { - struct sctp_packet *packet = NULL; + struct sctp_packet *packet; struct sctp_chunk *chunk = arg; struct sctp_chunk *shut;