* [PATCH v2] kernfs: remove an unused if statement in kernfs_path_from_node_locked()
@ 2022-11-26 11:16 Zhen Lei
2022-11-28 16:33 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Zhen Lei @ 2022-11-26 11:16 UTC (permalink / raw)
To: Greg Kroah-Hartman, Tejun Heo, linux-kernel; +Cc: Zhen Lei
It makes no sense to call kernfs_path_from_node_locked() with NULL buf,
and no one is doing that right now.
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
fs/kernfs/dir.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index f33b3baad07cb36..8a11bf189970274 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -149,9 +149,6 @@ static int kernfs_path_from_node_locked(struct kernfs_node *kn_to,
if (kn_from == kn_to)
return strlcpy(buf, "/", buflen);
- if (!buf)
- return -EINVAL;
-
common = kernfs_common_ancestor(kn_from, kn_to);
if (WARN_ON(!common))
return -EINVAL;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] kernfs: remove an unused if statement in kernfs_path_from_node_locked()
2022-11-26 11:16 [PATCH v2] kernfs: remove an unused if statement in kernfs_path_from_node_locked() Zhen Lei
@ 2022-11-28 16:33 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2022-11-28 16:33 UTC (permalink / raw)
To: Zhen Lei; +Cc: Greg Kroah-Hartman, linux-kernel
On Sat, Nov 26, 2022 at 07:16:34PM +0800, Zhen Lei wrote:
> It makes no sense to call kernfs_path_from_node_locked() with NULL buf,
> and no one is doing that right now.
>
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-28 16:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-26 11:16 [PATCH v2] kernfs: remove an unused if statement in kernfs_path_from_node_locked() Zhen Lei
2022-11-28 16:33 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).