From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
Henrik Rydberg <rydberg@bitmath.org>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: Input-evdev: Use kmalloc_array() in evdev_handle_get_val()
Date: Sat, 24 Sep 2016 11:34:55 -0700 [thread overview]
Message-ID: <20160924183455.GD40187@dtor-ws> (raw)
In-Reply-To: <56e70dc1-e36c-3492-d481-cef1e8262393@users.sourceforge.net>
On Sat, Sep 24, 2016 at 08:16:16PM +0200, SF Markus Elfring wrote:
> > So we have to multiply twice now, once in kmalloc_array, the second
> > time in memcpy().
>
> It looks so in the source code after the suggested refactoring.
>
>
> > No, thank you.
>
> Would you like to check any further if a specific compiler implementation
> will still optimise common subexpressions as you desired it?
>
>
> > Also, please note that we do not really treat the allocated "mem" as an array,
> > but rather area of memory that holds all bits that we need to transfer,
> > and so I consider using kmalloc_array() actually wrong here.
>
> Thanks for your explanation.
>
>
> > Please do not blindly follow checkpatch and coccinelle suggestions.
> > They are just that: suggestions and not hared rules.
>
> I am curious on how to clarify corresponding deviations further.
>
>
> Would you like to suggest any other details so that the evolving scripts
> can become better and safer for static source code analysis?
>
> Do you know any special properties which should be additionally checked
> at call sites which are similar to the discussed place?
If you are asking for some formal rules then no.
Again, what is the purpose of the changes? Are you working on the code
and the fact that the driver is older-style hinders your progress? Or
there are runtime improvements from your changes? Correctness issues?
I do not very much appreciate changes just to satisfy checkpatch rule
du jour.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2016-09-24 18:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <566ABCD9.1060404@users.sourceforge.net>
2015-12-12 9:16 ` [PATCH] uinput: Rename a jump label in uinput_ioctl_handler() SF Markus Elfring
2015-12-12 22:23 ` Dmitry Torokhov
2016-07-02 19:00 ` [PATCH 0/2] Input-at32psif: Fine-tuning for OOM handling in psif_probe() SF Markus Elfring
2016-07-02 19:05 ` [PATCH 1/2] Input-at32psif: Return directly after a failed kzalloc() " SF Markus Elfring
2016-07-02 19:07 ` [PATCH 2/2] Input-at32psif: Remove OOM messages " SF Markus Elfring
2016-07-02 19:29 ` Julia Lawall
2016-07-02 20:45 ` [PATCH 0/2] Input-at32psif: Fine-tuning for OOM handling " Joe Perches
2016-07-03 8:01 ` SF Markus Elfring
2016-07-13 22:01 ` Dmitry Torokhov
2016-09-24 11:07 ` [PATCH 0/2] Input-evdev: Fine-tuning for three function implementations SF Markus Elfring
2016-09-24 11:08 ` [PATCH 1/2] Input-evdev: Use kmalloc_array() in evdev_handle_get_val() SF Markus Elfring
2016-09-24 17:54 ` Dmitry Torokhov
2016-09-24 18:16 ` SF Markus Elfring
2016-09-24 18:34 ` Dmitry Torokhov [this message]
2016-09-24 19:04 ` SF Markus Elfring
2016-09-24 11:10 ` [PATCH 2/2] Input-evdev: Rename a jump label in two functions SF Markus Elfring
2016-09-24 17:47 ` Dmitry Torokhov
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=20160924183455.GD40187@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=elfring@users.sourceforge.net \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@bitmath.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