Message ID | 20190618155047.16894-1-gregkh@linuxfoundation.org |
---|---|
State | New |
Headers | show |
Series | [1/3] gpiolib: no need to cast away return value of debugfs_create_file() | expand |
On Tue, Jun 18, 2019 at 5:50 PM Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > It is fine to ignore the return value (and encouraged), so need to cast > away the return value, you will not get a build warning at all. > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> > Cc: linux-gpio@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch applied. Yours, Linus Walleij
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index e013d417a936..d378774d3456 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -4805,8 +4805,8 @@ static const struct file_operations gpiolib_operations = { static int __init gpiolib_debugfs_init(void) { /* /sys/kernel/debug/gpio */ - (void) debugfs_create_file("gpio", S_IFREG | S_IRUGO, - NULL, NULL, &gpiolib_operations); + debugfs_create_file("gpio", S_IFREG | S_IRUGO, NULL, NULL, + &gpiolib_operations); return 0; } subsys_initcall(gpiolib_debugfs_init);
It is fine to ignore the return value (and encouraged), so need to cast away the return value, you will not get a build warning at all. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: linux-gpio@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/gpio/gpiolib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)