Message ID | 20190618155047.16894-2-gregkh@linuxfoundation.org |
---|---|
State | New |
Headers | show |
Series | [1/3] gpiolib: no need to cast away return value of debugfs_create_file() | expand |
On 18/06/2019 16:50, Greg Kroah-Hartman wrote: > It is fine to ignore the return value (and encouraged), so need to cast I assume you mean 'no need' here. > 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: Thierry Reding <thierry.reding@gmail.com> > Cc: Jonathan Hunter <jonathanh@nvidia.com> > Cc: linux-gpio@vger.kernel.org > Cc: linux-tegra@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > --- > drivers/gpio/gpio-tegra.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c > index 6d9b6906b9d0..a54bba1bda6c 100644 > --- a/drivers/gpio/gpio-tegra.c > +++ b/drivers/gpio/gpio-tegra.c > @@ -550,8 +550,8 @@ DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); > > static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) > { > - (void) debugfs_create_file("tegra_gpio", 0444, > - NULL, tgi, &tegra_dbg_gpio_fops); > + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, > + &tegra_dbg_gpio_fops); > } > > #else Looks like we can get rid of this entire function and just call debugfs_create_file directly to simplify the code even more. We can handle that. Acked-by: Jon Hunter <jonathanh@nvidia.com> Thanks Jon
On Tue, Jun 18, 2019 at 05:26:28PM +0100, Jon Hunter wrote: > > On 18/06/2019 16:50, Greg Kroah-Hartman wrote: > > It is fine to ignore the return value (and encouraged), so need to cast > > I assume you mean 'no need' here. {sigh} yes :) > > 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: Thierry Reding <thierry.reding@gmail.com> > > Cc: Jonathan Hunter <jonathanh@nvidia.com> > > Cc: linux-gpio@vger.kernel.org > > Cc: linux-tegra@vger.kernel.org > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > --- > > drivers/gpio/gpio-tegra.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c > > index 6d9b6906b9d0..a54bba1bda6c 100644 > > --- a/drivers/gpio/gpio-tegra.c > > +++ b/drivers/gpio/gpio-tegra.c > > @@ -550,8 +550,8 @@ DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); > > > > static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) > > { > > - (void) debugfs_create_file("tegra_gpio", 0444, > > - NULL, tgi, &tegra_dbg_gpio_fops); > > + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, > > + &tegra_dbg_gpio_fops); > > } > > > > #else > > Looks like we can get rid of this entire function and just call > debugfs_create_file directly to simplify the code even more. We can > handle that. > > Acked-by: Jon Hunter <jonathanh@nvidia.com> Great! Do you want to just take this through your tree and then add that change on top of it? Or do you need me to take it and make that change? thanks, greg k-h
On 18/06/2019 18:17, Greg Kroah-Hartman wrote: > On Tue, Jun 18, 2019 at 05:26:28PM +0100, Jon Hunter wrote: >> >> On 18/06/2019 16:50, Greg Kroah-Hartman wrote: >>> It is fine to ignore the return value (and encouraged), so need to cast >> >> I assume you mean 'no need' here. > > {sigh} yes :) > >>> 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: Thierry Reding <thierry.reding@gmail.com> >>> Cc: Jonathan Hunter <jonathanh@nvidia.com> >>> Cc: linux-gpio@vger.kernel.org >>> Cc: linux-tegra@vger.kernel.org >>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> >>> --- >>> drivers/gpio/gpio-tegra.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c >>> index 6d9b6906b9d0..a54bba1bda6c 100644 >>> --- a/drivers/gpio/gpio-tegra.c >>> +++ b/drivers/gpio/gpio-tegra.c >>> @@ -550,8 +550,8 @@ DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); >>> >>> static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) >>> { >>> - (void) debugfs_create_file("tegra_gpio", 0444, >>> - NULL, tgi, &tegra_dbg_gpio_fops); >>> + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, >>> + &tegra_dbg_gpio_fops); >>> } >>> >>> #else >> >> Looks like we can get rid of this entire function and just call >> debugfs_create_file directly to simplify the code even more. We can >> handle that. >> >> Acked-by: Jon Hunter <jonathanh@nvidia.com> > > Great! Do you want to just take this through your tree and then add > that change on top of it? Or do you need me to take it and make that > change? No its fine, we can fix this. Cheers Jon
On Tue, Jun 18, 2019 at 06:49:23PM +0100, Jon Hunter wrote: > > On 18/06/2019 18:17, Greg Kroah-Hartman wrote: > > On Tue, Jun 18, 2019 at 05:26:28PM +0100, Jon Hunter wrote: > >> > >> On 18/06/2019 16:50, Greg Kroah-Hartman wrote: > >>> It is fine to ignore the return value (and encouraged), so need to cast > >> > >> I assume you mean 'no need' here. > > > > {sigh} yes :) > > > >>> 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: Thierry Reding <thierry.reding@gmail.com> > >>> Cc: Jonathan Hunter <jonathanh@nvidia.com> > >>> Cc: linux-gpio@vger.kernel.org > >>> Cc: linux-tegra@vger.kernel.org > >>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > >>> --- > >>> drivers/gpio/gpio-tegra.c | 4 ++-- > >>> 1 file changed, 2 insertions(+), 2 deletions(-) > >>> > >>> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c > >>> index 6d9b6906b9d0..a54bba1bda6c 100644 > >>> --- a/drivers/gpio/gpio-tegra.c > >>> +++ b/drivers/gpio/gpio-tegra.c > >>> @@ -550,8 +550,8 @@ DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); > >>> > >>> static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) > >>> { > >>> - (void) debugfs_create_file("tegra_gpio", 0444, > >>> - NULL, tgi, &tegra_dbg_gpio_fops); > >>> + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, > >>> + &tegra_dbg_gpio_fops); > >>> } > >>> > >>> #else > >> > >> Looks like we can get rid of this entire function and just call > >> debugfs_create_file directly to simplify the code even more. We can > >> handle that. > >> > >> Acked-by: Jon Hunter <jonathanh@nvidia.com> > > > > Great! Do you want to just take this through your tree and then add > > that change on top of it? Or do you need me to take it and make that > > change? > > No its fine, we can fix this. Wonderful, thank you! greg k-h
On Tue, Jun 18, 2019 at 05:50:46PM +0200, Greg Kroah-Hartman 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: Thierry Reding <thierry.reding@gmail.com> > Cc: Jonathan Hunter <jonathanh@nvidia.com> > Cc: linux-gpio@vger.kernel.org > Cc: linux-tegra@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > --- > drivers/gpio/gpio-tegra.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Thierry Reding <treding@nvidia.com>
On Tue, Jun 18, 2019 at 5:51 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: Thierry Reding <thierry.reding@gmail.com> > Cc: Jonathan Hunter <jonathanh@nvidia.com> > Cc: linux-gpio@vger.kernel.org > Cc: linux-tegra@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch applied, fixing wording and stacking up the ACKs. Yours, Linus Walleij
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 6d9b6906b9d0..a54bba1bda6c 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -550,8 +550,8 @@ DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) { - (void) debugfs_create_file("tegra_gpio", 0444, - NULL, tgi, &tegra_dbg_gpio_fops); + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, + &tegra_dbg_gpio_fops); } #else
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: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-gpio@vger.kernel.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/gpio/gpio-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)