diff mbox

Input: remove a duplicative NULL test

Message ID 20140221085506.GB13185@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Feb. 21, 2014, 8:55 a.m. UTC
"pdata" is non-NULL here.  We verified that at the start of the
function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

fugang.duan@freescale.com Feb. 21, 2014, 9:14 a.m. UTC | #1
From: Dan Carpenter <dan.carpenter@oracle.com>
Data: Friday, February 21, 2014 4:55 PM

>To: Dmitry Torokhov
>Cc: Paul Gortmaker; Jingoo Han; Duan Fugang-B38611; Benson Leung; Daniel Kurtz;
>linux-input@vger.kernel.org; kernel-janitors@vger.kernel.org
>Subject: [patch] Input: remove a duplicative NULL test
>
>"pdata" is non-NULL here.  We verified that at the start of the function.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
>diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c
>b/drivers/input/touchscreen/atmel_mxt_ts.c
>index a70400754e92..40abe90cc924 100644
>--- a/drivers/input/touchscreen/atmel_mxt_ts.c
>+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
>@@ -1146,7 +1146,7 @@ static int mxt_probe(struct i2c_client *client,
> 		goto err_free_mem;
> 	}
>
>-	data->is_tp = pdata && pdata->is_tp;
>+	data->is_tp = pdata->is_tp;
>
> 	input_dev->name = (data->is_tp) ? "Atmel maXTouch Touchpad" :
> 					  "Atmel maXTouch Touchscreen";
>
Agree, it is redundant. And if you have free time, you can convert the driver to support devicetree.

Acked-by: Fugang Duan <B38611@freescale.com>
--
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
Benson Leung March 13, 2014, 4:24 a.m. UTC | #2
On Fri, Feb 21, 2014 at 1:14 AM, fugang.duan@freescale.com
<fugang.duan@freescale.com> wrote:
>
> Agree, it is redundant. And if you have free time, you can convert the driver to support devicetree.

Please check with Nick Dyer before you convert this driver to support
devicetree. Much of the platform data this driver uses has been
eliminated or consolidated in a patch series that he's been working
on.
Nick Dyer March 19, 2014, 4:02 p.m. UTC | #3
> On Fri, Feb 21, 2014 at 1:14 AM, fugang.duan@freescale.com
> <fugang.duan@freescale.com> wrote:
>>
>> Agree, it is redundant. And if you have free time, you can convert
>> the driver to support devicetree.
> 
> Please check with Nick Dyer before you convert this driver to support
> devicetree. Much of the platform data this driver uses has been
> eliminated or consolidated in a patch series that he's been working
> on.

If you look at the "improve T19 GPIO keys handling" patch in the patch set
I posted to linux-input on 17th March, this redundant NULL test has been
removed.

I want to remove most of the existing platform data since it is not generic
across all chips - see "remove unnecessary platform data" and "read screen
config from chip" in that series of patches. It's high priority on my list
to implement device tree support for the remaining items, which will be
just irqflags and the touchpad key config.
--
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/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index a70400754e92..40abe90cc924 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1146,7 +1146,7 @@  static int mxt_probe(struct i2c_client *client,
 		goto err_free_mem;
 	}
 
-	data->is_tp = pdata && pdata->is_tp;
+	data->is_tp = pdata->is_tp;
 
 	input_dev->name = (data->is_tp) ? "Atmel maXTouch Touchpad" :
 					  "Atmel maXTouch Touchscreen";