From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Erick Archer <erick.archer@outlook.com>
Cc: "Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
"Ricardo Ribalda" <ribalda@chromium.org>,
"Andrzej Pietrasiewicz" <andrzej.p@collabora.com>,
"Oliver Graute" <oliver.graute@kococonnector.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"ye xingchen" <ye.xingchen@zte.com.cn>,
"Jason Gerecke" <jason.gerecke@wacom.com>,
"Kees Cook" <keescook@chromium.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"Justin Stitt" <justinstitt@google.com>,
"Support Opensource" <support.opensource@diasemi.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] Input: touchscreen - use sizeof(*pointer) instead of sizeof(type)
Date: Sun, 9 Jun 2024 14:41:07 -0700 [thread overview]
Message-ID: <ZmYhc89_PXsKQqj8@google.com> (raw)
In-Reply-To: <AS8PR02MB723708364CC0DF2EAAFEE5968BC42@AS8PR02MB7237.eurprd02.prod.outlook.com>
On Sat, Jun 08, 2024 at 04:34:49PM +0200, Erick Archer wrote:
> It is preferred to use sizeof(*pointer) instead of sizeof(type)
> due to the type of the variable can change and one needs not
> change the former (unlike the latter).
>
> The refactoring is mostly trivial except for "usbtouchscreen.c"
> file. Here, in the "mtouch_alloc" and "nexio_alloc" functions,
> it is necessary to use a variable with a predefined type instead
> of the "usbtouch->priv" variable (void * type). This way, the
> "sizeof" operator can now know the correct size. Moreover, we
> need to set the "usbtouch->priv" pointer after the memory
> allocation since now the "kmalloc" return value is not assigned
> directly.
>
> This patch has no effect on runtime behavior.
>
> Signed-off-by: Erick Archer <erick.archer@outlook.com>
Applied, thank you.
--
Dmitry
prev parent reply other threads:[~2024-06-09 21:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-08 14:34 [PATCH] Input: touchscreen - use sizeof(*pointer) instead of sizeof(type) Erick Archer
2024-06-09 21:41 ` 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=ZmYhc89_PXsKQqj8@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=andrzej.p@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=erick.archer@outlook.com \
--cc=gustavoars@kernel.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jason.gerecke@wacom.com \
--cc=justinstitt@google.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.graute@kococonnector.com \
--cc=ribalda@chromium.org \
--cc=support.opensource@diasemi.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=ye.xingchen@zte.com.cn \
/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