From: "Michael S. Tsirkin" <mst@redhat.com>
To: Haixu Cui <quic_haixcui@quicinc.com>
Cc: andriy.shevchenko@intel.com, harald.mommer@oss.qualcomm.com,
quic_msavaliy@quicinc.com, broonie@kernel.org,
virtio-dev@lists.linux.dev, viresh.kumar@linaro.org,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
hdanton@sina.com, qiang4.zhang@linux.intel.com,
alex.bennee@linaro.org, quic_ztu@quicinc.com
Subject: Re: [PATCH v4 2/3] virtio-spi: Add virtio-spi.h
Date: Thu, 28 Aug 2025 06:34:04 -0400 [thread overview]
Message-ID: <20250828063350-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1a63f5f9-add0-4a22-b01c-2f0c8d9efcec@quicinc.com>
On Mon, Aug 25, 2025 at 05:19:03PM +0800, Haixu Cui wrote:
>
>
> On 8/21/2025 4:45 PM, Michael S. Tsirkin wrote:
>
>
> > > +
> > > +/* Sample data on trailing clock edge */
> > > +#define VIRTIO_SPI_CPHA _BITUL(0)
> > > +/* Clock is high when IDLE */
> > > +#define VIRTIO_SPI_CPOL _BITUL(1)
> > > +/* Chip Select is active high */
> > > +#define VIRTIO_SPI_CS_HIGH _BITUL(2)
> > > +/* Transmit LSB first */
> > > +#define VIRTIO_SPI_MODE_LSB_FIRST _BITUL(3)
> > > +/* Loopback mode */
> > > +#define VIRTIO_SPI_MODE_LOOP _BITUL(4)
> >
> > It is generally preferable to have an enum with just bit
> > numbers.
> >
> >
> > E.g.
> >
> > enum {
> > VIRTIO_SPI_F_CPHA = 0,
> > }
> >
> >
> > Userspace can add _BITUL wrappers itself if it
> > wants.
> >
> >
>
> Hi Michael,
>
> Thank you for the suggestion regarding the bit definitions.
>
> Would it be acceptable to keep the current macro definitions with _BITUL()
> because these macros are also used within the virtio SPI driver itself?
>
> Looking forward to your guidance.
>
> Best regards,
> Haixu Cui
>
move them to the .c file if you want them.
next prev parent reply other threads:[~2025-08-28 10:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 8:49 [PATCH v4 0/3] Virtio SPI Linux driver Haixu Cui
2025-08-20 8:49 ` [PATCH v4 1/3] virtio: Add ID for virtio SPI Haixu Cui
2025-08-20 8:49 ` [PATCH v4 2/3] virtio-spi: Add virtio-spi.h Haixu Cui
2025-08-20 14:22 ` Andy Shevchenko
2025-08-25 8:35 ` Haixu Cui
2025-08-21 8:42 ` Michael S. Tsirkin
2025-08-25 9:12 ` Haixu Cui
2025-08-28 10:19 ` Michael S. Tsirkin
2025-08-21 8:45 ` Michael S. Tsirkin
2025-08-25 9:19 ` Haixu Cui
2025-08-28 10:34 ` Michael S. Tsirkin [this message]
2025-09-03 6:55 ` Haixu Cui
2025-09-03 7:00 ` Haixu Cui
2025-08-20 8:49 ` [PATCH v4 3/3] SPI: Add virtio SPI driver Haixu Cui
2025-08-20 14:39 ` Andy Shevchenko
2025-08-25 9:01 ` Haixu Cui
2025-08-21 2:22 ` kernel test robot
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=20250828063350-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=andriy.shevchenko@intel.com \
--cc=broonie@kernel.org \
--cc=harald.mommer@oss.qualcomm.com \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=qiang4.zhang@linux.intel.com \
--cc=quic_haixcui@quicinc.com \
--cc=quic_msavaliy@quicinc.com \
--cc=quic_ztu@quicinc.com \
--cc=viresh.kumar@linaro.org \
--cc=virtio-dev@lists.linux.dev \
/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).