sctp: sm_statefuns: Remove unnecessary ‘NULL’ values from Pointer

Message ID 20221115015508.3054-1-zeming@nfschina.com
State New
Headers
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

Paolo Abeni Nov. 17, 2022, 12:13 p.m. UTC | #1
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
  
Li zeming Nov. 18, 2022, 1:35 a.m. UTC | #2
Many thanks. I resubmit a patch.
  

Patch

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;