All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hpfs: remove redundant variable r
@ 2022-05-08 21:36 Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2022-05-08 21:36 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: kernel-janitors, linux-kernel

Variable r is being assigned a value that is never used, the assignment
and the variable are redundant and can be removed.

Cleans up clang scan warning:
fs/hpfs/namei.c:560:8: warning: Although the value stored to 'r' is
used in the enclosing expression, the value is never actually read
from 'r' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/hpfs/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index 15fc63276caa..d4a57e476013 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -556,8 +556,7 @@ static int hpfs_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
 	de.hidden = new_name[0] == '.';
 
 	if (new_inode) {
-		int r;
-		if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1)) != 2) {
+		if (hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1) != 2) {
 			if ((nde = map_dirent(new_dir, hpfs_i(new_dir)->i_dno, new_name, new_len, NULL, &qbh1))) {
 				clear_nlink(new_inode);
 				copy_de(nde, &de);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] hpfs: remove redundant variable r
@ 2021-12-30 15:33 Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2021-12-30 15:33 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: kernel-janitors, linux-kernel

The variable r is being assigned a value and it is never read. The
declaration and assignment are redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/hpfs/namei.c                   | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index d73f8a67168e..81b44bac4e1f 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -555,8 +555,7 @@ static int hpfs_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
 	de.hidden = new_name[0] == '.';
 
 	if (new_inode) {
-		int r;
-		if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1)) != 2) {
+		if (hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1) != 2) {
 			if ((nde = map_dirent(new_dir, hpfs_i(new_dir)->i_dno, new_name, new_len, NULL, &qbh1))) {
 				clear_nlink(new_inode);
 				copy_de(nde, &de);
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-08 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08 21:36 [PATCH] hpfs: remove redundant variable r Colin Ian King
  -- strict thread matches above, loose matches on Subject: below --
2021-12-30 15:33 Colin Ian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.