mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Ye Xiang <xiang.ye@intel.com>
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-kernel@vger.kernel.org,
	linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org,
	srinivas.pandruvada@intel.com, heikki.krogerus@linux.intel.com,
	andriy.shevchenko@linux.intel.com, sakari.ailus@linux.intel.com,
	zhifeng.wang@intel.com, wentong.wu@intel.com,
	lixu.zhang@intel.com
Subject: Re: [PATCH v2 4/5] spi: Add support for Intel LJCA USB SPI driver
Date: Mon, 27 Feb 2023 17:23:09 +0000	[thread overview]
Message-ID: <Y/zm/Uk/d6VRxLBx@sirena.org.uk> (raw)
In-Reply-To: <20230225140118.2037220-5-xiang.ye@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]

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?

> +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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-02-27 17:23 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 [this message]
2023-02-28  6:41     ` Ye, Xiang
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/zm/Uk/d6VRxLBx@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --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=lixu.zhang@intel.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=srinivas.pandruvada@intel.com \
    --cc=wentong.wu@intel.com \
    --cc=wsa@kernel.org \
    --cc=xiang.ye@intel.com \
    --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

all inboxes | Powered by JetHome®