* [PATCH][next] fsdax: remove redundant variable 'error'
@ 2023-06-21 13:02 Colin Ian King
2023-06-21 13:28 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2023-06-21 13:02 UTC (permalink / raw)
To: Dan Williams, Matthew Wilcox, Jan Kara, Alexander Viro,
Christian Brauner, linux-fsdevel, nvdimm
Cc: kernel-janitors, linux-kernel
The variable 'error' is being assigned a value that is never read,
the assignment and the variable and redundant and can be removed.
Cleans up clang scan build warning:
fs/dax.c:1880:10: warning: Although the value stored to 'error' is
used in the enclosing expression, the value is never actually read
from 'error' [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/dax.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 2ababb89918d..cb36c6746fc4 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1830,7 +1830,6 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
vm_fault_t ret = VM_FAULT_FALLBACK;
pgoff_t max_pgoff;
void *entry;
- int error;
if (vmf->flags & FAULT_FLAG_WRITE)
iter.flags |= IOMAP_WRITE;
@@ -1877,7 +1876,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
}
iter.pos = (loff_t)xas.xa_index << PAGE_SHIFT;
- while ((error = iomap_iter(&iter, ops)) > 0) {
+ while (iomap_iter(&iter, ops) > 0) {
if (iomap_length(&iter) < PMD_SIZE)
continue; /* actually breaks out of the loop */
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][next] fsdax: remove redundant variable 'error'
2023-06-21 13:02 [PATCH][next] fsdax: remove redundant variable 'error' Colin Ian King
@ 2023-06-21 13:28 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2023-06-21 13:28 UTC (permalink / raw)
To: Colin Ian King
Cc: Dan Williams, Matthew Wilcox, Jan Kara, Alexander Viro,
Christian Brauner, linux-fsdevel, nvdimm, kernel-janitors,
linux-kernel
On Wed 21-06-23 14:02:56, Colin Ian King wrote:
> The variable 'error' is being assigned a value that is never read,
> the assignment and the variable and redundant and can be removed.
> Cleans up clang scan build warning:
>
> fs/dax.c:1880:10: warning: Although the value stored to 'error' is
> used in the enclosing expression, the value is never actually read
> from 'error' [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Yeah, good spotting. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/dax.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 2ababb89918d..cb36c6746fc4 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1830,7 +1830,6 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
> vm_fault_t ret = VM_FAULT_FALLBACK;
> pgoff_t max_pgoff;
> void *entry;
> - int error;
>
> if (vmf->flags & FAULT_FLAG_WRITE)
> iter.flags |= IOMAP_WRITE;
> @@ -1877,7 +1876,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
> }
>
> iter.pos = (loff_t)xas.xa_index << PAGE_SHIFT;
> - while ((error = iomap_iter(&iter, ops)) > 0) {
> + while (iomap_iter(&iter, ops) > 0) {
> if (iomap_length(&iter) < PMD_SIZE)
> continue; /* actually breaks out of the loop */
>
> --
> 2.39.2
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-21 13:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 13:02 [PATCH][next] fsdax: remove redundant variable 'error' Colin Ian King
2023-06-21 13:28 ` Jan Kara
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®