diff mbox

sensor-hub: Remove pointless NULL check

Message ID 20121009142010.16433.64833.stgit@bob.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Alan Cox Oct. 9, 2012, 2:20 p.m. UTC
From: Alan Cox <alan@linux.intel.com>

report cannot be NULL, fortunately as we use it before we check !

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/hid/hid-sensor-hub.c |    4 ----
 1 file changed, 4 deletions(-)



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

Comments

srinivas pandruvada Oct. 18, 2012, 6:58 p.m. UTC | #1
Agreed. It was a mistake.

Thanks,
Srinivas

On 10/09/2012 07:20 AM, Alan Cox wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> report cannot be NULL, fortunately as we use it before we check !
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>
>   drivers/hid/hid-sensor-hub.c |    4 ----
>   1 file changed, 4 deletions(-)
>
>
> diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
> index d9d73e9..4ff2497 100644
> --- a/drivers/hid/hid-sensor-hub.c
> +++ b/drivers/hid/hid-sensor-hub.c
> @@ -437,9 +437,6 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
>   	ptr = raw_data;
>   	ptr++; /*Skip report id*/
>   
> -	if (!report)
> -		goto err_report;
> -
>   	spin_lock_irqsave(&pdata->lock, flags);
>   
>   	for (i = 0; i < report->maxfield; ++i) {
> @@ -485,7 +482,6 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
>   				callback->pdev);
>   	spin_unlock_irqrestore(&pdata->lock, flags);
>   
> -err_report:
>   	return 1;
>   }
>   
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index d9d73e9..4ff2497 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -437,9 +437,6 @@  static int sensor_hub_raw_event(struct hid_device *hdev,
 	ptr = raw_data;
 	ptr++; /*Skip report id*/
 
-	if (!report)
-		goto err_report;
-
 	spin_lock_irqsave(&pdata->lock, flags);
 
 	for (i = 0; i < report->maxfield; ++i) {
@@ -485,7 +482,6 @@  static int sensor_hub_raw_event(struct hid_device *hdev,
 				callback->pdev);
 	spin_unlock_irqrestore(&pdata->lock, flags);
 
-err_report:
 	return 1;
 }