Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: Remove redundant null pointer checks in pinctrl_remove_device_debugfs()

Since the debugfs_create_dir() never returns a null pointer, checking
the return value for a null pointer is redundant, and using IS_ERR is
safe enough.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/20240903143812.2005071-1-lizetao1@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Li Zetao and committed by
Linus Walleij
92f43683 dbf0e9d9

+1 -1
+1 -1
drivers/pinctrl/core.c
··· 1971 1971 static void pinctrl_init_debugfs(void) 1972 1972 { 1973 1973 debugfs_root = debugfs_create_dir("pinctrl", NULL); 1974 - if (IS_ERR(debugfs_root) || !debugfs_root) { 1974 + if (IS_ERR(debugfs_root)) { 1975 1975 pr_warn("failed to create debugfs directory\n"); 1976 1976 debugfs_root = NULL; 1977 1977 return;