From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Shuah Khan <skhan@linuxfoundation.org>,
Advait Dhamorikar <advaitdhamorikar@gmail.com>,
Steve French <sfrench@samba.org>,
Paulo Alcantara <pc@manguebit.com>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>,
Shyam Prasad N <sprasad@microsoft.com>,
Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>,
David Howells <dhowells@redhat.com>,
Enzo Matsumiya <ematsumiya@suse.de>
Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
linux-kernel@vger.kernel.org, anupnewsmail@gmail.com
Subject: Re: [PATCH] Fix logically dead code
Date: Fri, 4 Oct 2024 20:12:30 +0200 [thread overview]
Message-ID: <c973f853-87b6-4dba-955f-1eccecd60f8c@wanadoo.fr> (raw)
In-Reply-To: <b04634a4-1301-4f73-a6eb-05ef79954aee@linuxfoundation.org>
Le 04/10/2024 à 20:00, Shuah Khan a écrit :
> On 10/4/24 04:30, Advait Dhamorikar wrote:
>> The if condition in collect_sample: can never be satisfied
>> because of a logical contradiction.
>
> Add a better change log explaining how you found the problem.
>
> Also your short log is missing subsystem information.
> Check submitting patches document for details on how
> to write shot logs and change logs.
>
>>
>> Fixes: 94ae8c3fee94 ("smb: client: compress: LZ77 code improvements
>> cleanup")
>> Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
>> ---
>> fs/smb/client/compress.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/fs/smb/client/compress.c b/fs/smb/client/compress.c
>> index 63b5a55b7a57..766b4de13da7 100644
>> --- a/fs/smb/client/compress.c
>> +++ b/fs/smb/client/compress.c
>> @@ -166,7 +166,6 @@ static int collect_sample(const struct iov_iter
>> *iter, ssize_t max, u8 *sample)
>> loff_t start = iter->xarray_start + iter->iov_offset;
>> pgoff_t last, index = start / PAGE_SIZE;
>> size_t len, off, foff;
>> - ssize_t ret = 0;
>> void *p;
>> int s = 0;
>> @@ -193,9 +192,6 @@ static int collect_sample(const struct iov_iter
>> *iter, ssize_t max, u8 *sample)
>> memcpy(&sample[s], p, len2);
>> kunmap_local(p);
>> - if (ret < 0)
>> - return ret;
>> -
>
> The change itself looks good to me - unless the intent is to
> check the return from kunmap_local() and take action based on
> it instead of removing the conditional that checks the ret value.
IIUC, kunmap_local() does not return anything.
CJ
>
>> s += len2;
>> if (len2 < SZ_2K || s >= max - SZ_2K)
>
> thanks,
> -- Shuah
>
>
next prev parent reply other threads:[~2024-10-04 18:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 10:30 Advait Dhamorikar
2024-10-04 18:00 ` Shuah Khan
2024-10-04 18:12 ` Christophe JAILLET [this message]
2024-10-05 20:19 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c973f853-87b6-4dba-955f-1eccecd60f8c@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=advaitdhamorikar@gmail.com \
--cc=anupnewsmail@gmail.com \
--cc=bharathsm@microsoft.com \
--cc=dhowells@redhat.com \
--cc=ematsumiya@suse.de \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pc@manguebit.com \
--cc=ronniesahlberg@gmail.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=skhan@linuxfoundation.org \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®