From: He Zhe <zhe.he@windriver.com>
To: Arnd Bergmann <arnd@arndb.de>,
Clemens Ladisch <clemens@ladisch.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hpet: Support 32-bit userspace
Date: Thu, 6 Jun 2024 20:37:39 +0800 [thread overview]
Message-ID: <ea5fcbf7-408a-4edb-aefa-15f17e712139@windriver.com> (raw)
In-Reply-To: <5050968c-6807-4688-ad7c-24c19820f1e6@app.fastmail.com>
On 2024/6/6 18:34, Arnd Bergmann wrote:
> On Thu, Jun 6, 2024, at 11:46, He Zhe wrote:
>> v2:
>> - Use in_compat_syscall to determine if we're handling 32-bit or 64-bit
>> - Drop unnecessary compat_ptr for hpet_ioctl_common
>> - Add comment for COMPAT_HPET_INFO and COMPAT_HPET_IRQFREQ
> Thanks, this version looks correct to me,
>
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
>
> I would suggest one simplification though:
Thanks. v3 is sent.
Zhe
>
>> +#ifdef CONFIG_COMPAT
>> + if (in_compat_syscall()) {
>> + if (count < sizeof(compat_ulong_t))
>> + return -EINVAL;
>> + } else {
>> + if (count < sizeof(unsigned long))
>> + return -EINVAL;
>> + }
>> +#else
>> if (count < sizeof(unsigned long))
>> return -EINVAL;
>> +#endif
> The #ifdef/#else is not really required here, since
> in_compat_syscall() is defined to return false when
> this is unset. For both cases, it should be sufficient
> to keep the part inside of the #ifdef block.
>
> Arnd
prev parent reply other threads:[~2024-06-06 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 9:46 [PATCH v2] hpet: Support 32-bit userspace He Zhe
2024-06-06 10:34 ` Arnd Bergmann
2024-06-06 12:37 ` He Zhe [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=ea5fcbf7-408a-4edb-aefa-15f17e712139@windriver.com \
--to=zhe.he@windriver.com \
--cc=arnd@arndb.de \
--cc=clemens@ladisch.de \
--cc=gregkh@linuxfoundation.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