[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64e8d13a-5811-774b-9e94-20ff747b1d0d@linux.alibaba.com>
Date: Mon, 11 Dec 2023 18:57:13 +0800
From: Wen Gu <guwen@...ux.alibaba.com>
To: Alexandra Winter <wintera@...ux.ibm.com>, wenjia@...ux.ibm.com,
hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, kgraul@...ux.ibm.com, jaka@...ux.ibm.com
Cc: borntraeger@...ux.ibm.com, svens@...ux.ibm.com,
alibuda@...ux.alibaba.com, tonylu@...ux.alibaba.com,
raspl@...ux.ibm.com, schnelle@...ux.ibm.com,
guangguan.wang@...ux.alibaba.com, linux-s390@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v5 2/9] net/smc: introduce sub-functions for
smc_clc_send_confirm_accept()
On 2023/12/11 17:47, Alexandra Winter wrote:
>
>
> On 09.12.23 03:50, Wen Gu wrote:
>>
>>
>> On 2023/12/8 15:40, Wen Gu wrote:
>>
>>> There is a large if-else block in smc_clc_send_confirm_accept() and it
>>> is better to split it into two sub-functions.
>>>
>>> Suggested-by: Alexandra Winter <wintera@...ux.ibm.com>
>>> Signed-off-by: Wen Gu <guwen@...ux.alibaba.com>
>>> ---
>>> net/smc/smc_clc.c | 196 +++++++++++++++++++++++++++++++-----------------------
>>> 1 file changed, 114 insertions(+), 82 deletions(-)
>>>
>>> diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
>>> index 0fcb035..52b4ea9 100644
>>> --- a/net/smc/smc_clc.c
>>> +++ b/net/smc/smc_clc.c
>>> @@ -998,6 +998,111 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini)
>>> return reason_code;
>>> }
>>> +static void smcd_clc_prep_confirm_accept(struct smc_connection *conn,
>>> + struct smc_clc_msg_accept_confirm_v2 *clc_v2,
>>
>> checkpatch will complain 'Alignment should match open parenthesis' here.
>> But in order to make the length less than 80 columns, there seems to be
>> no other good way.
>>
>>> + int first_contact, u8 version,
>>> + u8 *eid, struct smc_init_info *ini,
>>> + int *fce_len,
>>> + struct smc_clc_first_contact_ext_v2x *fce_v2x,
>>> + struct smc_clc_msg_trail *trl)
>>> +{
>> <...>
>>
>>> +
>>> +static void smcr_clc_prep_confirm_accept(struct smc_connection *conn,
>>> + struct smc_clc_msg_accept_confirm_v2 *clc_v2,
>>
>> And here.
>>
>>> + int first_contact, u8 version,
>>> + u8 *eid, struct smc_init_info *ini,
>>> + int *fce_len,
>>> + struct smc_clc_first_contact_ext_v2x *fce_v2x,
>>> + struct smc_clc_fce_gid_ext *gle,
>>> + struct smc_clc_msg_trail *trl)
>>> +{
>> <...>
>>
>
>
> You could shorten the names of the functions
Thank you. I thought about that too, but I think shortening the name may
have an impact on the understanding.
I think the following may be another way out and checkpatch is happy:
+static void
+smcd_clc_prep_confirm_accept(struct smc_connection *conn,
+ struct smc_clc_msg_accept_confirm_v2 *clc_v2,
+ int first_contact, u8 version,
+ u8 *eid, struct smc_init_info *ini,
+ int *fce_len,
+ struct smc_clc_first_contact_ext_v2x *fce_v2x,
+ struct smc_clc_msg_trail *trl)
and
+static void
+smcr_clc_prep_confirm_accept(struct smc_connection *conn,
+ struct smc_clc_msg_accept_confirm_v2 *clc_v2,
+ int first_contact, u8 version,
+ u8 *eid, struct smc_init_info *ini,
+ int *fce_len,
+ struct smc_clc_first_contact_ext_v2x *fce_v2x,
+ struct smc_clc_fce_gid_ext *gle,
+ struct smc_clc_msg_trail *trl)
Powered by blists - more mailing lists