Skip to content

Commit d82e86c

Browse files
Sergey ShtylyovTrond Myklebust
authored andcommitted
nfs: direct: drop useless initializer in nfs_direct_write_completion()
In nfs_direct_write_completion(), the local variable req isn't used outside the *while* loop and is assigned to right at the start of that loop's body, so its initializer appears useless -- drop it; then move the declaration to the loop body (which happens to have a pointless empty line anyway)... Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool. Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Link: https://lore.kernel.org/r/416219f5-7983-484b-b5a7-5fb7da9561f7@omp.ru Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent d5fb22a commit d82e86c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/direct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,6 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
757757
{
758758
struct nfs_direct_req *dreq = hdr->dreq;
759759
struct nfs_commit_info cinfo;
760-
struct nfs_page *req = nfs_list_entry(hdr->pages.next);
761760
struct inode *inode = dreq->inode;
762761
int flags = NFS_ODIRECT_DONE;
763762

@@ -786,6 +785,7 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
786785
spin_unlock(&inode->i_lock);
787786

788787
while (!list_empty(&hdr->pages)) {
788+
struct nfs_page *req;
789789

790790
req = nfs_list_entry(hdr->pages.next);
791791
nfs_list_remove_request(req);

0 commit comments

Comments
 (0)