From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Fengping yu <fengping.yu@mediatek.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Marco Felsch <m.felsch@pengutronix.de>,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
wsd_upstream@mediatek.com, linux-input@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 3/3] drivers: input: keyboard: add mtk keypad driver
Date: Thu, 23 Apr 2020 13:41:07 +0300 [thread overview]
Message-ID: <20200423104107.GO185537@smile.fi.intel.com> (raw)
In-Reply-To: <20200423011958.30521-4-fengping.yu@mediatek.com>
On Thu, Apr 23, 2020 at 09:20:02AM +0800, Fengping yu wrote:
> From: "fengping.yu" <fengping.yu@mediatek.com>
>
This misses the commit message. It's a show stopper for such patches.
Read this [1].
[1]: https://chris.beams.io/posts/git-commit/
...
> +#define KPD_DEBOUNCE_MASK GENMASK(13, 0)
> +#define KPD_DEBOUNCE_MAX 256000
Is there any unit in which debounce time is being measured? Add it as a suffix
to the definition, if it's possible.
...
> +#define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32))
This already defined in bits.h.
...
> + keypad->base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(keypad->base)) {
> + dev_err(&pdev->dev, "Failed to get resource and iomap keypad\n");
This is duplicate noisy message, please remove.
> + return PTR_ERR(keypad->base);
> + }
...
> + writew(keypad->key_debounce * 32 / 1000 & KPD_DEBOUNCE_MASK,
Perhaps one pair of parentheses is needed to make logic clear.
(Yes, I remember I commented on this in earlier versions where it was many
parentheses around above calculations, but you have to use common sense as well)
> + keypad->base + KP_DEBOUNCE);
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2020-04-23 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 1:19 [PATCH v5] add mtk matrix keypad driver for keypad on MTK SoC Fengping yu
[not found] ` <20200423011958.30521-2-fengping.yu@mediatek.com>
2020-04-23 5:26 ` [PATCH v5 1/3] dt-bindings: add matrix keypad documentation Marco Felsch
[not found] ` <20200423011958.30521-3-fengping.yu@mediatek.com>
2020-04-23 5:28 ` [PATCH v5 2/3] arm64: configs: defconfig: enable mtk keypad config Marco Felsch
2020-04-23 5:29 ` [PATCH v5] add mtk matrix keypad driver for keypad on MTK SoC Marco Felsch
[not found] ` <20200423011958.30521-4-fengping.yu@mediatek.com>
2020-04-23 6:47 ` [PATCH v5 3/3] drivers: input: keyboard: add mtk keypad driver Marco Felsch
2020-04-23 10:41 ` Andy Shevchenko [this message]
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=20200423104107.GO185537@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=fengping.yu@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=m.felsch@pengutronix.de \
--cc=wsd_upstream@mediatek.com \
--cc=yingjoe.chen@mediatek.com \
/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).