diff mbox series

[net-next] sctp: Remove commented out code

Message ID 20250211102057.587182-1-thorsten.blum@linux.dev (mailing list archive)
State Accepted
Commit 34dba73b231f2a46af88519d573052cc57a84952
Delegated to: Netdev Maintainers
Headers show
Series [net-next] sctp: Remove commented out code | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success Errors and warnings before: 26 (+1) this patch: 26 (+1)
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/build_clang success Errors and warnings before: 170 this patch: 170
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 17 this patch: 17
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-12--06-00 (tests: 889)

Commit Message

Thorsten Blum Feb. 11, 2025, 10:20 a.m. UTC
Remove commented out code.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 include/linux/sctp.h | 1 -
 1 file changed, 1 deletion(-)

Comments

Mateusz Polchlopek Feb. 11, 2025, 10:49 a.m. UTC | #1
On 2/11/2025 11:20 AM, Thorsten Blum wrote:
> Remove commented out code.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>   include/linux/sctp.h | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/include/linux/sctp.h b/include/linux/sctp.h
> index 836a7e200f39..812011d8b67e 100644
> --- a/include/linux/sctp.h
> +++ b/include/linux/sctp.h
> @@ -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/cover.1681917361.git.lucien.xin@gmail.com/

Thanks
Thorsten Blum Feb. 11, 2025, 11:17 a.m. UTC | #2
On 11. Feb 2025, at 11:49, Mateusz Polchlopek wrote:
> On 2/11/2025 11:20 AM, Thorsten Blum wrote:
>> Remove commented out code.
>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>> ---
>>  include/linux/sctp.h | 1 -
>>  1 file changed, 1 deletion(-)
>> diff --git a/include/linux/sctp.h b/include/linux/sctp.h
>> index 836a7e200f39..812011d8b67e 100644
>> --- a/include/linux/sctp.h
>> +++ b/include/linux/sctp.h
>> @@ -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/cover.1681917361.git.lucien.xin@gmail.com/

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
Mateusz Polchlopek Feb. 11, 2025, 11:33 a.m. UTC | #3
On 2/11/2025 12:17 PM, Thorsten Blum wrote:
> On 11. Feb 2025, at 11:49, Mateusz Polchlopek wrote:
>> On 2/11/2025 11:20 AM, Thorsten Blum wrote:
>>> Remove commented out code.
>>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>>> ---
>>>   include/linux/sctp.h | 1 -
>>>   1 file changed, 1 deletion(-)
>>> diff --git a/include/linux/sctp.h b/include/linux/sctp.h
>>> index 836a7e200f39..812011d8b67e 100644
>>> --- a/include/linux/sctp.h
>>> +++ b/include/linux/sctp.h
>>> @@ -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/cover.1681917361.git.lucien.xin@gmail.com/
> 
> 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?"
> 

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

> Thanks,
> Thorsten
Jakub Kicinski Feb. 13, 2025, 3:57 a.m. UTC | #4
On Tue, 11 Feb 2025 12:33:57 +0100 Mateusz Polchlopek wrote:
> >> 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/cover.1681917361.git.lucien.xin@gmail.com/  
> > 
> > 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?"
> >   
> 
> 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.
Thorsten Blum Feb. 13, 2025, 10:49 a.m. UTC | #5
Hi Jakub,

> On 13. Feb 2025, at 04:57, Jakub Kicinski wrote:
> On Tue, 11 Feb 2025 12:33:57 +0100 Mateusz Polchlopek wrote:
>>>> 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/cover.1681917361.git.lucien.xin@gmail.com/  
>>> 
>>> 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?"
>>> 
>> 
>> 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.

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

Were you referring to this patch maybe?
https://lore.kernel.org/r/20250114215439.916207-3-thorsten.blum@linux.dev/

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

Thanks,
Thorsten
Mateusz Polchlopek Feb. 13, 2025, 12:05 p.m. UTC | #6
On 2/13/2025 11:49 AM, Thorsten Blum wrote:
> Hi Jakub,
> 
>> On 13. Feb 2025, at 04:57, Jakub Kicinski wrote:
>> On Tue, 11 Feb 2025 12:33:57 +0100 Mateusz Polchlopek wrote:
>>>>> 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/cover.1681917361.git.lucien.xin@gmail.com/
>>>>
>>>> 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?"
>>>>
>>>
>>> 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.
> 
> This patch deletes the line and I'm wondering why the "cr"?
> 
> Were you referring to this patch maybe?
> https://lore.kernel.org/r/20250114215439.916207-3-thorsten.blum@linux.dev/
> 
> 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
Jakub Kicinski Feb. 13, 2025, 3:29 p.m. UTC | #7
On Thu, 13 Feb 2025 11:49:45 +0100 Thorsten Blum wrote:
> > 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.
patchwork-bot+netdevbpf@kernel.org Feb. 13, 2025, 4:50 p.m. UTC | #8
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 11 Feb 2025 11:20:56 +0100 you wrote:
> Remove commented out code.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  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!
diff mbox series

Patch

diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 836a7e200f39..812011d8b67e 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -222,7 +222,6 @@  struct sctp_datahdr {
 	__be16 stream;
 	__be16 ssn;
 	__u32 ppid;
-	/* __u8  payload[]; */
 };
 
 struct sctp_data_chunk {