diff mbox series

HID: thrustmaster: fix sparse warnings

Message ID 20211113200448.GA1111164@makvihas (mailing list archive)
State Mainlined
Commit fa48020c9fae2872f7bf8f38e09f73eb61fdb4ce
Delegated to: Jiri Kosina
Headers show
Series HID: thrustmaster: fix sparse warnings | expand

Commit Message

Vihas Mak Nov. 13, 2021, 8:04 p.m. UTC
Changed 0 to NULL to fix following sparse warnings:

    drivers/hid/hid-thrustmaster.c:208:43: warning: Using plain integer as NULL pointer
    drivers/hid/hid-thrustmaster.c:241:17: warning: Using plain integer as NULL pointer
    drivers/hid/hid-thrustmaster.c:275:37: warning: Using plain integer as NULL pointer

Signed-off-by: Vihas Mak <makvihas@gmail.com>
---
 drivers/hid/hid-thrustmaster.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jiri Kosina Nov. 19, 2021, 2:53 p.m. UTC | #1
On Sun, 14 Nov 2021, Vihas Mak wrote:

> Changed 0 to NULL to fix following sparse warnings:
> 
>     drivers/hid/hid-thrustmaster.c:208:43: warning: Using plain integer as NULL pointer
>     drivers/hid/hid-thrustmaster.c:241:17: warning: Using plain integer as NULL pointer
>     drivers/hid/hid-thrustmaster.c:275:37: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Vihas Mak <makvihas@gmail.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c
index d44550aa8..3a5333424 100644
--- a/drivers/hid/hid-thrustmaster.c
+++ b/drivers/hid/hid-thrustmaster.c
@@ -205,7 +205,7 @@  static void thrustmaster_model_handler(struct urb *urb)
 	struct tm_wheel *tm_wheel = hid_get_drvdata(hdev);
 	uint16_t model = 0;
 	int i, ret;
-	const struct tm_wheel_info *twi = 0;
+	const struct tm_wheel_info *twi = NULL;
 
 	if (urb->status) {
 		hid_err(hdev, "URB to get model id failed with error %d\n", urb->status);
@@ -238,7 +238,7 @@  static void thrustmaster_model_handler(struct urb *urb)
 		tm_wheel->usb_dev,
 		usb_sndctrlpipe(tm_wheel->usb_dev, 0),
 		(char *)tm_wheel->change_request,
-		0, 0, // We do not expect any response from the wheel
+		NULL, 0, // We do not expect any response from the wheel
 		thrustmaster_change_handler,
 		hdev
 	);
@@ -272,7 +272,7 @@  static void thrustmaster_remove(struct hid_device *hdev)
 static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_id *id)
 {
 	int ret = 0;
-	struct tm_wheel *tm_wheel = 0;
+	struct tm_wheel *tm_wheel = NULL;
 
 	ret = hid_parse(hdev);
 	if (ret) {