From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Kang Hu <hukangustc@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] Input: remove a redundant max() call.
Date: Thu, 31 Oct 2013 00:48:08 -0700 [thread overview]
Message-ID: <20131031074808.GA1886@core.coreip.homeip.net> (raw)
In-Reply-To: <1383204394-15399-1-git-send-email-hukangustc@gmail.com>
On Thu, Oct 31, 2013 at 03:26:34PM +0800, Kang Hu wrote:
> dev->hint_events_per_packet is guaranteed to be >= packet_size.
> so an extra max() call is not needed.
Applied, thank you.
>
> Signed-off-by: Kang Hu <hukangustc@gmail.com>
> ---
> drivers/input/input.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index c044699..fb513da 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -2048,7 +2048,7 @@ int input_register_device(struct input_dev *dev)
> if (dev->hint_events_per_packet < packet_size)
> dev->hint_events_per_packet = packet_size;
>
> - dev->max_vals = max(dev->hint_events_per_packet, packet_size) + 2;
> + dev->max_vals = dev->hint_events_per_packet + 2;
> dev->vals = kcalloc(dev->max_vals, sizeof(*dev->vals), GFP_KERNEL);
> if (!dev->vals) {
> error = -ENOMEM;
> --
> 1.8.3.1
>
--
Dmitry
prev parent reply other threads:[~2013-10-31 7:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 7:26 [PATCH 1/1] Input: remove a redundant max() call Kang Hu
2013-10-31 7:48 ` Dmitry Torokhov [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=20131031074808.GA1886@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=hukangustc@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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).