From: "Ye, Xiang" <xiang.ye@intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Lee Jones <lee@kernel.org>, Wolfram Sang <wsa@kernel.org>,
Tyrone Ting <kfting@nuvoton.com>,
Linus Walleij <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>,
"heikki.krogerus@linux.intel.com"
<heikki.krogerus@linux.intel.com>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
"Wang, Zhifeng" <zhifeng.wang@intel.com>,
"Wu, Wentong" <Wentong.Wu@intel.com>,
"Zhang, Lixu" <Lixu.Zhang@intel.com>
Subject: Re: [PATCH v2 4/5] spi: Add support for Intel LJCA USB SPI driver
Date: Tue, 28 Feb 2023 14:41:14 +0800 [thread overview]
Message-ID: <Y/2iCn6M/+HWsjZD@ye-NUC7i7DNHE> (raw)
In-Reply-To: <Y/zm/Uk/d6VRxLBx@sirena.org.uk>
Hi Mark,
Thanks for the review.
On Tue, Feb 28, 2023 at 01:23:09AM +0800, Mark Brown wrote:
> On Sat, Feb 25, 2023 at 10:01:17PM +0800, Ye Xiang wrote:
>
> > +struct spi_xfer_packet {
> > + u8 indicator;
> > + s8 len;
> > + u8 data[];
> > +} __packed;
>
> > +static int ljca_spi_read_write(struct ljca_spi_dev *ljca_spi, const u8 *w_data, u8 *r_data, int len,
> > + int id, int complete, int cmd)
> > +{
> > + struct spi_xfer_packet *w_packet = (struct spi_xfer_packet *)ljca_spi->obuf;
> > + struct spi_xfer_packet *r_packet = (struct spi_xfer_packet *)ljca_spi->ibuf;
> > + unsigned int ibuf_len = LJCA_SPI_BUF_SIZE;
> > + int ret;
> > +
> > + w_packet->indicator = FIELD_PREP(LJCA_SPI_XFER_INDICATOR_ID, id) |
> > + FIELD_PREP(LJCA_SPI_XFER_INDICATOR_CMPL, complete) |
> > + FIELD_PREP(LJCA_SPI_XFER_INDICATOR_INDEX,
> > + ljca_spi->spi_info->id);
> > +
> > + if (cmd == LJCA_SPI_READ) {
> > + w_packet->len = sizeof(u16);
> > + *(u16 *)&w_packet->data[0] = len;
>
> Are there no endianness considerations here?
Yes, it should be little endian. Will address this.
>
> > +static int ljca_spi_transfer(struct ljca_spi_dev *ljca_spi, const u8 *tx_data,
> > + u8 *rx_data, u16 len)
> > +{
>
> This function has one caller with barely anything in it - perhaps just
> inline it?
Agree. Will make this function inline.
--
Thanks
Ye Xiang
next prev parent reply other threads:[~2023-02-28 6:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-25 14:01 [PATCH v2 0/5] Add Intel LJCA device driver Ye Xiang
2023-02-25 14:01 ` [PATCH v2 1/5] mfd: Add support for Intel LJCA device Ye Xiang
2023-02-25 14:01 ` [PATCH v2 2/5] gpio: Add support for Intel LJCA USB GPIO driver Ye Xiang
2023-03-06 14:02 ` Linus Walleij
2023-02-25 14:01 ` [PATCH v2 3/5] i2c: Add support for Intel LJCA USB I2C driver Ye Xiang
2023-02-25 14:01 ` [PATCH v2 4/5] spi: Add support for Intel LJCA USB SPI driver Ye Xiang
2023-02-27 17:23 ` Mark Brown
2023-02-28 6:41 ` Ye, Xiang [this message]
2023-02-25 14:01 ` [PATCH v2 5/5] Documentation: Add ABI doc for attributes of LJCA device Ye Xiang
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=Y/2iCn6M/+HWsjZD@ye-NUC7i7DNHE \
--to=xiang.ye@intel.com \
--cc=Lixu.Zhang@intel.com \
--cc=Wentong.Wu@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kfting@nuvoton.com \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=srinivas.pandruvada@intel.com \
--cc=wsa@kernel.org \
--cc=zhifeng.wang@intel.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;
as well as URLs for NNTP newsgroup(s).