[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <717a6d2a-b3f8-4296-b0b3-8738d1c1dab2@web.de>
Date: Wed, 8 Oct 2025 21:40:25 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Henrique Carvalho <henrique.carvalho@...e.com>,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
Bharath SM <bharathsm@...rosoft.com>, Paulo Alcantara <pc@...guebit.org>,
Pavel Shilovsky <pshilov@...rosoft.com>,
Ronnie Sahlberg <ronniesahlberg@...il.com>,
Shyam Prasad N <sprasad@...rosoft.com>, Steve French <sfrench@...ba.org>,
Tom Talpey <tom@...pey.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] smb: client: Move an error code assignment in
smb3_init_transform_rq()
>> Convert an initialisation for the variable “rc” into an error code
>> assignment at the end of this function implementation.
…>> +++ b/fs/smb/client/smb2ops.c
…>> @@ -4611,7 +4611,7 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst,
>> if (size > 0) {
>> buffer = cifs_alloc_folioq_buffer(size);
>> if (!buffer)
>> - goto err_free;
>> + goto e_nomem;
>>
>> new->rq_buffer = buffer;
>> iov_iter_folio_queue(&new->rq_iter, ITER_SOURCE,
>> @@ -4634,6 +4634,8 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst,
>>
>> return rc;
>>
>> +e_nomem:
>> + rc = -ENOMEM;
>> err_free:
>> smb3_free_compound_rqst(num_rqst - 1, &new_rq[1]);
>> return rc;
>
> I don't think this change improves readability.
>
> I understand that making the assignment explicit is good,
Thanks for this constructive feedback.
> but why not simply set rc to -ENOMEM if !buffer and then goto err_free?
I proposed to adjust the affected if branch in this way
because there is no need to add curly brackets then.
> Also, I think its a bit confusing having inconsistent naming styles `e_`
> `err_`...
Which naming approach would you find more helpful for the marking
of a variable assignment instead of a subsequent function call?
Regards,
Markus
Powered by blists - more mailing lists