public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paller, Kim Seer" <KimSeer.Paller@analog.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "jic23@kernel.org" <jic23@kernel.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"Hennerich, Michael" <Michael.Hennerich@analog.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzysztof.kozlowski@linaro.org" <krzysztof.kozlowski@linaro.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: RE: [PATCH v7 2/2] iio: adc: max14001: New driver
Date: Wed, 21 Jun 2023 00:38:08 +0000	[thread overview]
Message-ID: <e92f919e59974bb2ae32a8d961e07538@analog.com> (raw)
In-Reply-To: <CAHp75VdR9W8U9VmP5WZntzB9qW3fM6qy1Q2-yeBSAG5PJimkaw@mail.gmail.com>


> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
> Sent: Tuesday, June 20, 2023 11:15 PM
> To: Paller, Kim Seer <KimSeer.Paller@analog.com>
> Cc: jic23@kernel.org; lars@metafoo.de; lgirdwood@gmail.com;
> broonie@kernel.org; Hennerich, Michael <Michael.Hennerich@analog.com>;
> robh@kernel.org; krzysztof.kozlowski@linaro.org; conor+dt@kernel.org; linux-
> iio@vger.kernel.org; linux-kernel@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [PATCH v7 2/2] iio: adc: max14001: New driver
> 
> [External]
> 
> On Tue, Jun 20, 2023 at 4:27 PM Kim Seer Paller
> <kimseer.paller@analog.com> wrote:
> >
> > The MAX14001 is configurable, isolated 10-bit ADCs for multi-range
> > binary inputs.
> 
> ...
> 
> > +       /*
> > +        * Align received data from the receive buffer, reversing and reordering
> > +        * it to match the expected MSB-first format.
> > +        */
> > +       *data = (__force u16)(be16_to_cpu(bitrev16(st->spi_rx_buffer))) &
> > +                                                       MAX14001_DATA_MASK;
> 
> Using __force in the C files is somehow stinky.
> 
> ...
> 
> > +       /*
> > +        * Convert transmit buffer to big-endian format and reverse transmit
> > +        * buffer to align with the LSB-first input on SDI port.
> > +        */
> > +       st->spi_tx_buffer = (__force u16)(cpu_to_be16(bitrev16(
> 
> You have a different type of spi_tx_buffer than u16, don't you?

I have the same type of spi_tx_buffer as u16. 

Other than using force cast, is there any way to resolve the endian warning? I have 
actually swapped the order of bitrev16() and cpu_to_be16/be16_to_cpu() functions. 
I have tested and they also work fine.

Best regards,
Kim Seer Paller


  reply	other threads:[~2023-06-21  0:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 13:26 [PATCH v7 1/2] dt-bindings: iio: adc: add max14001 Kim Seer Paller
2023-06-20 13:26 ` [PATCH v7 2/2] iio: adc: max14001: New driver Kim Seer Paller
2023-06-20 15:15   ` Andy Shevchenko
2023-06-21  0:38     ` Paller, Kim Seer [this message]
2023-06-21  8:21       ` Andy Shevchenko
2023-06-20 13:29 ` [PATCH v7 1/2] dt-bindings: iio: adc: add max14001 Krzysztof Kozlowski

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=e92f919e59974bb2ae32a8d961e07538@analog.com \
    --to=kimseer.paller@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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