From: "Arnd Bergmann" <arnd@arndb.de>
To: "Vamsi Attunuru" <vattunuru@marvell.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Jeff Johnson" <quic_jjohnson@quicinc.com>
Subject: Re: [EXTERNAL] Re: [PATCH] misc: mrvl-cn10k-dpi: resolve compilation issues on 32-bit ARM
Date: Wed, 17 Jul 2024 07:39:57 +0200 [thread overview]
Message-ID: <22bf9a24-b4db-4017-b5a9-1b03e6f20bff@app.fastmail.com> (raw)
In-Reply-To: <MW4PR18MB5244DBBC231E986EDBEDD5BEA6A32@MW4PR18MB5244.namprd18.prod.outlook.com>
On Wed, Jul 17, 2024, at 07:35, Vamsi Krishna Attunuru wrote:
>>> #include <uapi/misc/mrvl_cn10k_dpi.h>
>>>
>>> @@ -185,6 +188,8 @@ struct dpi_mbox_message {
>>> uint64_t word_h;
>>> };
>>>
>>> +#ifdef CONFIG_64BIT
>>> +
>>> static inline void dpi_reg_write(struct dpipf *dpi, u64 offset, u64
>>> val) {
>>> writeq(val, dpi->reg_base + offset); @@ -195,6 +200,40 @@ static
>>> inline u64 dpi_reg_read(struct dpipf *dpi, u64 offset)
>>> return readq(dpi->reg_base + offset); }
>>>
>>> +static inline void dpi_writeq(u64 val, void __iomem *addr) {
>>> + writeq(val, addr);
>>> +}
>>> +
>>> +static inline u64 dpi_readq(const void __iomem *addr) {
>>> + return readq(addr);
>>> +}
>>> +
>>> +#else
>>
>>Normally we do not like #ifdef in .c files, are you sure this is the correct way to
>>handle this?
>
> Ok, came across the similar usage in some other drivers and presumed
> it's fine with small routines. I will move the #ifdef inside the
> routines than.
>
> Thank you, Greg, for the prompt feedback.
You shouldn't need any #ifdef here, just call readq/writeq
unconditionally after including the header.
Have you been able to confirm whether the device works
correctly with the lo_hi ordering?
Arnd
next prev parent reply other threads:[~2024-07-17 5:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 4:52 Vamsi Attunuru
2024-07-17 5:16 ` Greg KH
2024-07-17 5:35 ` [EXTERNAL] " Vamsi Krishna Attunuru
2024-07-17 5:39 ` Arnd Bergmann [this message]
2024-07-17 11:45 ` Vamsi Krishna Attunuru
2024-07-17 11:49 ` Arnd Bergmann
2024-07-17 12:17 ` Vamsi Krishna Attunuru
2024-07-17 12:52 ` Arnd Bergmann
2024-07-17 13:41 ` Nathan Chancellor
2024-07-17 13:59 ` Jeff Johnson
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=22bf9a24-b4db-4017-b5a9-1b03e6f20bff@app.fastmail.com \
--to=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=quic_jjohnson@quicinc.com \
--cc=vattunuru@marvell.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
all inboxes | Powered by JetHome®