Skip to contentSkip to conversation

HSI: omap_ssi_port: skip useless NULL pointer check

PATCH In review Arnd Bergmann 2 participants 2 messages Mar 24 HSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HSI: omap_ssi_port: skip useless NULL pointer check

From: Arnd Bergmann <[email protected]>

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")
---
 drivers/hsi/controllers/omap_ssi_port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_port.c +1 -1
index 50dde968febe..73932d7257d3 100644
@@ -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;
Signature · 1 line
2.39.5
#1 lore raw
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 7 lines

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")

https://lore.kernel.org/lkml/[email protected]/

Whichever makes it in is fine with me.

Quoted 20 lines
---
 drivers/hsi/controllers/omap_ssi_port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_port.c +1 -2
index 50dde968febe..73932d7257d3 100644
@@ -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