linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: thrustmaster: fix sparse warnings
@ 2021-11-13 20:04 Vihas Mak
  2021-11-19 14:53 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Vihas Mak @ 2021-11-13 20:04 UTC (permalink / raw)
  To: jikos
  Cc: benjamin.tissoires, mcoquelin.stm32, alexandre.torgue,
	linux-input, linux-stm32, linux-arm-kernel, linux-kernel

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

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) {
-- 
2.25.1


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

* Re: [PATCH] HID: thrustmaster: fix sparse warnings
  2021-11-13 20:04 [PATCH] HID: thrustmaster: fix sparse warnings Vihas Mak
@ 2021-11-19 14:53 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2021-11-19 14:53 UTC (permalink / raw)
  To: Vihas Mak
  Cc: benjamin.tissoires, mcoquelin.stm32, alexandre.torgue,
	linux-input, linux-stm32, linux-arm-kernel, linux-kernel

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.

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2021-11-19 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-13 20:04 [PATCH] HID: thrustmaster: fix sparse warnings Vihas Mak
2021-11-19 14:53 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).