Skip to contentSkip to conversation

watchdog: wdat_wdt: Fix warning for using 0 as NULL

PATCH In review Wei Yongjun 4 participants 4 messages Sep 28, 2016 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: wdat_wdt: Fix warning for using 0 as NULL

From: Wei Yongjun <[email protected]>

Fixes the following sparse warnings:

drivers/watchdog/wdat_wdt.c:210:66: warning: Using plain integer as NULL pointer drivers/watchdog/wdat_wdt.c:235:66: warning: Using plain integer as NULL pointer

---
 drivers/watchdog/wdat_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/wdat_wdt.c +2 -2
index 6b64645..7ab923f 100644
@@ -207,7 +207,7 @@ static int wdat_wdt_enable_reboot(struct wdat_wdt *wdat)
 	 * recommeded to make it configurable through hardware register. We
 	 * enable reboot now if it is configrable, just in case.
 	 */
-	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_REBOOT, 0, 0);
+	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_REBOOT, 0, NULL);
 	if (ret && ret != -EOPNOTSUPP) {
 		dev_err(&wdat->pdev->dev,
 			"Failed to enable reboot when watchdog triggers\n");
@@ -232,7 +232,7 @@ static void wdat_wdt_boot_status(struct wdat_wdt *wdat)
 		wdat->wdd.bootstatus = WDIOF_CARDRESET;
 
 	/* Clear the boot status in case BIOS did not do it */
-	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_STATUS, 0, 0);
+	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_STATUS, 0, NULL);
 	if (ret && ret != -EOPNOTSUPP)
 		dev_err(&wdat->pdev->dev, "Failed to clear boot status\n");
 }
#2 lore raw
Quoted 8 lines · Mika Westerberg
Quoted 7 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fixes the following sparse warnings:

drivers/watchdog/wdat_wdt.c:210:66: warning: Using plain integer as NULL pointer drivers/watchdog/wdat_wdt.c:235:66: warning: Using plain integer as NULL pointer

Quoted 6 lines
Quoted 1 line

Good catch!

(I should run sparse more often).

Applied (with tags).

Thanks,

Rafael

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Wei Yongjun
Quoted 8 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fixes the following sparse warnings:

drivers/watchdog/wdat_wdt.c:210:66: warning: Using plain integer as NULL pointer drivers/watchdog/wdat_wdt.c:235:66: warning: Using plain integer as NULL pointer

Quoted 31 lines
---
 drivers/watchdog/wdat_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/wdat_wdt.c +2 -3
index 6b64645..7ab923f 100644
@@ -207,7 +207,7 @@ static int wdat_wdt_enable_reboot(struct wdat_wdt *wdat)
 	 * recommeded to make it configurable through hardware register. We
 	 * enable reboot now if it is configrable, just in case.
 	 */
-	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_REBOOT, 0, 0);
+	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_REBOOT, 0, NULL);
 	if (ret && ret != -EOPNOTSUPP) {
 		dev_err(&wdat->pdev->dev,
 			"Failed to enable reboot when watchdog triggers\n");
@@ -232,7 +232,7 @@ static void wdat_wdt_boot_status(struct wdat_wdt *wdat)
 		wdat->wdd.bootstatus = WDIOF_CARDRESET;
 
 	/* Clear the boot status in case BIOS did not do it */
-	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_STATUS, 0, 0);
+	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_STATUS, 0, NULL);
 	if (ret && ret != -EOPNOTSUPP)
 		dev_err(&wdat->pdev->dev, "Failed to clear boot status\n");
 }
 
--

To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html