public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] HSI: omap_ssi_port: skip useless NULL pointer check
@ 2026-03-24 19:21 Arnd Bergmann
  2026-03-24 22:55 ` Rosen Penev
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2026-03-24 19:21 UTC (permalink / raw)
  To: Sebastian Reichel, Nathan Chancellor, Rosen Penev
  Cc: Arnd Bergmann, Nick Desaulniers, Bill Wendling, Justin Stitt,
	Sakari Ailus, linux-kernel, llvm

From: Arnd Bergmann <arnd@arndb.de>

ssi->port is no longer dynamically allocated, so there is now a warning
from clang about the check being always true:

drivers/hsi/controllers/omap_ssi_port.c:1121:12: error: address of array 'ssi->port' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
 1121 |         if (!ssi->port || !omap_ssi->port) {

Remove it, as was done in the hsi core code.

Fixes: e61af3ca8933 ("hsi: hsi_core: use kzalloc_flex")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/hsi/controllers/omap_ssi_port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c
index 50dde968febe..73932d7257d3 100644
--- a/drivers/hsi/controllers/omap_ssi_port.c
+++ b/drivers/hsi/controllers/omap_ssi_port.c
@@ -1118,7 +1118,7 @@ static int ssi_port_probe(struct platform_device *pd)
 
 	dev_dbg(&pd->dev, "init ssi port...\n");
 
-	if (!ssi->port || !omap_ssi->port) {
+	if (!omap_ssi->port) {
 		dev_err(&pd->dev, "ssi controller not initialized!\n");
 		err = -ENODEV;
 		goto error;
-- 
2.39.5


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

* Re: [PATCH] HSI: omap_ssi_port: skip useless NULL pointer check
  2026-03-24 19:21 [PATCH] HSI: omap_ssi_port: skip useless NULL pointer check Arnd Bergmann
@ 2026-03-24 22:55 ` Rosen Penev
  0 siblings, 0 replies; 2+ messages in thread
From: Rosen Penev @ 2026-03-24 22:55 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sebastian Reichel, Nathan Chancellor, Arnd Bergmann,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Sakari Ailus,
	linux-kernel, llvm

On Tue, Mar 24, 2026 at 12:21 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> ssi->port is no longer dynamically allocated, so there is now a warning
> from clang about the check being always true:
>
> drivers/hsi/controllers/omap_ssi_port.c:1121:12: error: address of array 'ssi->port' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
>  1121 |         if (!ssi->port || !omap_ssi->port) {
>
> Remove it, as was done in the hsi core code.
>
> Fixes: e61af3ca8933 ("hsi: hsi_core: use kzalloc_flex")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
https://lore.kernel.org/lkml/20260321034117.3746-1-rosenp@gmail.com/

Whichever makes it in is fine with me.
> ---
>  drivers/hsi/controllers/omap_ssi_port.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c
> index 50dde968febe..73932d7257d3 100644
> --- a/drivers/hsi/controllers/omap_ssi_port.c
> +++ b/drivers/hsi/controllers/omap_ssi_port.c
> @@ -1118,7 +1118,7 @@ static int ssi_port_probe(struct platform_device *pd)
>
>         dev_dbg(&pd->dev, "init ssi port...\n");
>
> -       if (!ssi->port || !omap_ssi->port) {
> +       if (!omap_ssi->port) {
>                 dev_err(&pd->dev, "ssi controller not initialized!\n");
>                 err = -ENODEV;
>                 goto error;
> --
> 2.39.5
>

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

end of thread, other threads:[~2026-03-24 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 19:21 [PATCH] HSI: omap_ssi_port: skip useless NULL pointer check Arnd Bergmann
2026-03-24 22:55 ` Rosen Penev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox