From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jeff LaBundy <jeff@labundy.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [RESEND] input: iqs62x-keys: Remove superfluous function parameter
Date: Wed, 16 Sep 2020 10:25:59 -0700 [thread overview]
Message-ID: <20200916172559.GJ1681290@dtor-ws> (raw)
In-Reply-To: <1600276053-3336-1-git-send-email-jeff@labundy.com>
Hi Jeff,
On Wed, Sep 16, 2020 at 12:07:33PM -0500, Jeff LaBundy wrote:
> It is not necessary to pass iqs62x_keys to iqs62x_keys_parse_prop,
> because it can already be derived from the platform_device cookie.
Yes, it can be derived, but why is better to have it derived rather than
passed in? Is the code smaller this way?
>
> Signed-off-by: Jeff LaBundy <jeff@labundy.com>
> ---
> drivers/input/keyboard/iqs62x-keys.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c
> index 93446b2..e2a2b38 100644
> --- a/drivers/input/keyboard/iqs62x-keys.c
> +++ b/drivers/input/keyboard/iqs62x-keys.c
> @@ -42,9 +42,9 @@ struct iqs62x_keys_private {
> u8 interval;
> };
>
> -static int iqs62x_keys_parse_prop(struct platform_device *pdev,
> - struct iqs62x_keys_private *iqs62x_keys)
> +static int iqs62x_keys_parse_prop(struct platform_device *pdev)
> {
> + struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev);
> struct fwnode_handle *child;
> unsigned int val;
> int ret, i;
> @@ -258,7 +258,7 @@ static int iqs62x_keys_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, iqs62x_keys);
>
> - ret = iqs62x_keys_parse_prop(pdev, iqs62x_keys);
> + ret = iqs62x_keys_parse_prop(pdev);
> if (ret)
> return ret;
>
> --
> 2.7.4
>
Thanks.
--
Dmitry
next prev parent reply other threads:[~2020-09-16 17:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 17:07 [RESEND] input: iqs62x-keys: Remove superfluous function parameter Jeff LaBundy
2020-09-16 17:25 ` Dmitry Torokhov [this message]
2020-09-16 20:07 ` Jeff LaBundy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200916172559.GJ1681290@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=jeff@labundy.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).