Skip to contentSkip to conversation

sctp: Remove commented out code

PATCH Applied Thorsten Blum 4 participants 9 messages Feb 11, 2025 – Feb 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sctp: Remove commented out code

Remove commented out code.

---
 include/linux/sctp.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sctp.h +0 -1
index 836a7e200f39..812011d8b67e 100644
@@ -222,7 +222,6 @@ struct sctp_datahdr {
 	__be16 stream;
 	__be16 ssn;
 	__u32 ppid;
-	/* __u8  payload[]; */
 };
 
 struct sctp_data_chunk {
Signature · 1 line
2.48.1
#1 lore raw
Quoted 12 lines · Thorsten Blum

Remove commented out code.

---
  include/linux/sctp.h | 1 -
  1 file changed, 1 deletion(-)
include/linux/sctp.h +0 -0
index 836a7e200f39..812011d8b67e 100644

include/linux/sctp.h struct sctp_datahdr { · line 227

Quoted 7 lines
include/linux/sctp.h +0 -1
@@ -222,7 +222,6 @@ struct sctp_datahdr {
  	__be16 stream;
  	__be16 ssn;
  	__u32 ppid;
-	/* __u8  payload[]; */
  };
 
  struct sctp_data_chunk {

Hi Thorsten

I don't think we want to remove that piece of code, please refer to the discussion under the link:

https://lore.kernel.org/netdev/[email protected]/

Thanks

#2 lore raw
Quoted 20 lines · Mateusz Polchlopek
Quoted 10 lines · Thorsten Blum

Remove commented out code.

---
 include/linux/sctp.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sctp.h +0 -0
index 836a7e200f39..812011d8b67e 100644

include/linux/sctp.h struct sctp_datahdr { · line 226

Quoted 6 lines
include/linux/sctp.h +0 -1
@@ -222,7 +222,6 @@ struct sctp_datahdr {
  __be16 stream;
  __be16 ssn;
  __u32 ppid;
- /* __u8  payload[]; */
 };
   struct sctp_data_chunk {

Hi Thorsten

Quoted 4 lines

I don't think we want to remove that piece of code, please refer to the discussion under the link:

https://lore.kernel.org/netdev/[email protected]/

Hm, the commit message (dbda0fba7a14) says payload was deleted because "the member is not even used anywhere," but it was just commented out. In the cover letter it then explains that "deleted" actually means "commented out."

However, I can't follow the reasoning in the cover letter either:

"Note that instead of completely deleting it, we just leave it as a comment in the struct, signalling to the reader that we do expect such variable parameters over there, as Marcelo suggested."

Where do I find Marcelo's suggestion and the "variable parameters over there?"

Thanks,
Thorsten

#3 lore raw
Quoted 31 lines · Thorsten Blum
Quoted 20 lines · Mateusz Polchlopek
Quoted 10 lines · Thorsten Blum

Remove commented out code.

---
  include/linux/sctp.h | 1 -
  1 file changed, 1 deletion(-)
include/linux/sctp.h +0 -0
index 836a7e200f39..812011d8b67e 100644

include/linux/sctp.h struct sctp_datahdr { · line 226

Quoted 6 lines
include/linux/sctp.h +0 -1
@@ -222,7 +222,6 @@ struct sctp_datahdr {
   __be16 stream;
   __be16 ssn;
   __u32 ppid;
- /* __u8  payload[]; */
  };
    struct sctp_data_chunk {

Hi Thorsten

Quoted 4 lines

I don't think we want to remove that piece of code, please refer to the discussion under the link:

https://lore.kernel.org/netdev/[email protected]/

Hm, the commit message (dbda0fba7a14) says payload was deleted because "the member is not even used anywhere," but it was just commented out. In the cover letter it then explains that "deleted" actually means "commented out."

Quoted 9 lines

However, I can't follow the reasoning in the cover letter either:

"Note that instead of completely deleting it, we just leave it as a comment in the struct, signalling to the reader that we do expect such variable parameters over there, as Marcelo suggested."

Where do I find Marcelo's suggestion and the "variable parameters over there?"

That's good question, I can't find the Marcelo suggestion that author mention. It's hard to find without links to previous series or discussion :/

I guess it should be also commented by maintainers, I see that in the Xin's thread Kuba also commented change with commenting out instead of removing code. Let's wait

Quoted 2 lines

Thanks,
Thorsten

maintainer
#4 lore raw
Quoted 20 lines · On Tue, 11 Feb 2025 12:33:57 +0100 Mateusz Polchlopek wrote:
Quoted 10 lines
Quoted 4 lines

I don't think we want to remove that piece of code, please refer to the discussion under the link:

https://lore.kernel.org/netdev/[email protected]/

Hm, the commit message (dbda0fba7a14) says payload was deleted because "the member is not even used anywhere," but it was just commented out. In the cover letter it then explains that "deleted" actually means "commented out."

Quoted 9 lines

However, I can't follow the reasoning in the cover letter either:

"Note that instead of completely deleting it, we just leave it as a comment in the struct, signalling to the reader that we do expect such variable parameters over there, as Marcelo suggested."

Where do I find Marcelo's suggestion and the "variable parameters over there?"

Quoted 7 lines

That's good question, I can't find the Marcelo suggestion that author mention. It's hard to find without links to previous series or discussion :/

I guess it should be also commented by maintainers, I see that in the Xin's thread Kuba also commented change with commenting out instead of removing code. Let's wait

In the linked thread the point was to document what struct will be next in memory. Here we'd be leaving an array of u8s which isn't very informative. I see there's precedent in this file, but I vote we just delete the line.

Signature · 1 line
pw-bot: cr
#5 lore raw

Hi Jakub,

Quoted 26 lines · Jakub Kicinski
Quoted 24 lines · On Tue, 11 Feb 2025 12:33:57 +0100 Mateusz Polchlopek wrote:
Quoted 10 lines
Quoted 4 lines

I don't think we want to remove that piece of code, please refer to the discussion under the link:

https://lore.kernel.org/netdev/[email protected]/

Hm, the commit message (dbda0fba7a14) says payload was deleted because "the member is not even used anywhere," but it was just commented out. In the cover letter it then explains that "deleted" actually means "commented out."

Quoted 9 lines

However, I can't follow the reasoning in the cover letter either:

"Note that instead of completely deleting it, we just leave it as a comment in the struct, signalling to the reader that we do expect such variable parameters over there, as Marcelo suggested."

Where do I find Marcelo's suggestion and the "variable parameters over there?"

That's good question, I can't find the Marcelo suggestion that author mention. It's hard to find without links to previous series or discussion :/

Quoted 8 lines
Quoted 3 lines

I guess it should be also commented by maintainers, I see that in the Xin's thread Kuba also commented change with commenting out instead of removing code. Let's wait

In the linked thread the point was to document what struct will be next in memory. Here we'd be leaving an array of u8s which isn't very informative. I see there's precedent in this file, but I vote we just delete the line.

This patch deletes the line and I'm wondering why the "cr"?

Were you referring to this patch maybe?
https://lore.kernel.org/r/[email protected]/

Should both payload fields just be deleted since they're not used?

Thanks,
Thorsten

#6 lore raw
Quoted 39 lines · Thorsten Blum

Hi Jakub,

Quoted 26 lines · Jakub Kicinski
Quoted 24 lines · On Tue, 11 Feb 2025 12:33:57 +0100 Mateusz Polchlopek wrote:
Quoted 10 lines
Quoted 4 lines

I don't think we want to remove that piece of code, please refer to the discussion under the link:

https://lore.kernel.org/netdev/[email protected]/

Hm, the commit message (dbda0fba7a14) says payload was deleted because "the member is not even used anywhere," but it was just commented out. In the cover letter it then explains that "deleted" actually means "commented out."

Quoted 9 lines

However, I can't follow the reasoning in the cover letter either:

"Note that instead of completely deleting it, we just leave it as a comment in the struct, signalling to the reader that we do expect such variable parameters over there, as Marcelo suggested."

Where do I find Marcelo's suggestion and the "variable parameters over there?"

That's good question, I can't find the Marcelo suggestion that author mention. It's hard to find without links to previous series or discussion :/

Quoted 8 lines
Quoted 3 lines

I guess it should be also commented by maintainers, I see that in the Xin's thread Kuba also commented change with commenting out instead of removing code. Let's wait

In the linked thread the point was to document what struct will be next in memory. Here we'd be leaving an array of u8s which isn't very informative. I see there's precedent in this file, but I vote we just delete the line.

This patch deletes the line and I'm wondering why the "cr"?

Quoted 7 lines

Were you referring to this patch maybe?
https://lore.kernel.org/r/[email protected]/

Should both payload fields just be deleted since they're not used?

Thanks,
Thorsten

Going further I see that in this file there are more fields in structures that are just commented out, like:

struct sctp_fwdtsn_hdr {
        __be32 new_cum_tsn;
        /* struct sctp_fwdtsn_skip skip[]; */
};

or

struct sctp_sackhdr {
        __be32 cum_tsn_ack;
        __be32 a_rwnd;
        __be16 num_gap_ack_blocks;
        __be16 num_dup_tsns;
        /* union sctp_sack_variable variable[]; */
};

Does it make sense to do the cleanup of the whole header in this patch ?

Thanks

maintainer
#7 lore raw
In reply to Thorsten Blum
Quoted 6 lines · On Thu, 13 Feb 2025 11:49:45 +0100 Thorsten Blum wrote:
Quoted 4 lines

In the linked thread the point was to document what struct will be next in memory. Here we'd be leaving an array of u8s which isn't very informative. I see there's precedent in this file, but I vote we just delete the line.

This patch deletes the line and I'm wondering why the "cr"?

My bad! Misread the diff.

#8 lore raw
In reply to Thorsten Blum
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Tue, 11 Feb 2025 11:20:56 +0100 you wrote:

Remove commented out code.

---
 include/linux/sctp.h | 1 -
 1 file changed, 1 deletion(-)

Here is the summary with links:
- [net-next] sctp: Remove commented out code

    https://git.kernel.org/netdev/net-next/c/34dba73b231f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html