[PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes()

Andy Shevchenko posted 2 patches 8 months ago
drivers/spi/spi-dw-core.c |  2 +-
drivers/spi/spi.c         |  2 +-
include/linux/spi/spi.h   | 26 ++++++++++++++++++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
[PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes()
Posted by Andy Shevchenko 8 months ago
Recently in the discussion with David the idea of having
a common helper popped up. The helper converts the given
bits per word to bytes. The result will always be power-of-two
(e.g. for 37 bits it returns 8 bytes) or 0 for 0 input.
More details are in the respective code comment.

This mini-series introduces it and replaces current users
under drivers/spi and we expect more (and possibly some
lurking in other subsystems).

Mark, if you okay with the idea, please, make this to be
an immutable branch or tag for others to pull.

In v3:
- fixed the typos in the examples

In v2:
- improved examples in the code comment and commit message (David)

Andy Shevchenko (2):
  spi: Add spi_bpw_to_bytes() helper and use it
  spi: dw: Use spi_bpw_to_bytes() helper

 drivers/spi/spi-dw-core.c |  2 +-
 drivers/spi/spi.c         |  2 +-
 include/linux/spi/spi.h   | 26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 2 deletions(-)

-- 
2.47.2
Re: [PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes()
Posted by Mark Brown 8 months ago
On Thu, 17 Apr 2025 18:24:45 +0300, Andy Shevchenko wrote:
> Recently in the discussion with David the idea of having
> a common helper popped up. The helper converts the given
> bits per word to bytes. The result will always be power-of-two
> (e.g. for 37 bits it returns 8 bytes) or 0 for 0 input.
> More details are in the respective code comment.
> 
> This mini-series introduces it and replaces current users
> under drivers/spi and we expect more (and possibly some
> lurking in other subsystems).
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: Add spi_bpw_to_bytes() helper and use it
      commit: 163ddf1fea590229c30a8dc4c29ff4febfb895c3
[2/2] spi: dw: Use spi_bpw_to_bytes() helper
      commit: e30b7a75666b3f444abfabed6a144642fa9994d8

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Re: [PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes()
Posted by Mukesh Kumar Savaliya 8 months ago

On 4/17/2025 8:54 PM, Andy Shevchenko wrote:
> Recently in the discussion with David the idea of having
> a common helper popped up. The helper converts the given
> bits per word to bytes. The result will always be power-of-two
> (e.g. for 37 bits it returns 8 bytes) or 0 for 0 input.
> More details are in the respective code comment.
> 
> This mini-series introduces it and replaces current users
> under drivers/spi and we expect more (and possibly some
> lurking in other subsystems).
> 
> Mark, if you okay with the idea, please, make this to be
> an immutable branch or tag for others to pull.
> 
> In v3:
> - fixed the typos in the examples
> 
> In v2:
> - improved examples in the code comment and commit message (David)
> 
> Andy Shevchenko (2):
>    spi: Add spi_bpw_to_bytes() helper and use it
>    spi: dw: Use spi_bpw_to_bytes() helper
> 
>   drivers/spi/spi-dw-core.c |  2 +-
>   drivers/spi/spi.c         |  2 +-
>   include/linux/spi/spi.h   | 26 ++++++++++++++++++++++++++
>   3 files changed, 28 insertions(+), 2 deletions(-)
> 
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
Re: [PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes()
Posted by David Lechner 8 months ago
On 4/17/25 10:24 AM, Andy Shevchenko wrote:
> Recently in the discussion with David the idea of having
> a common helper popped up. The helper converts the given
> bits per word to bytes. The result will always be power-of-two
> (e.g. for 37 bits it returns 8 bytes) or 0 for 0 input.
> More details are in the respective code comment.
> 
> This mini-series introduces it and replaces current users
> under drivers/spi and we expect more (and possibly some
> lurking in other subsystems).
> 
> Mark, if you okay with the idea, please, make this to be
> an immutable branch or tag for others to pull.
> 
> In v3:
> - fixed the typos in the examples
> 
> In v2:
> - improved examples in the code comment and commit message (David)
> 

Reviewed-by: David Lechner <dlechner@baylibre.com>
Re: [PATCH v3 0/2] spi: Introduce and use spi_bpw_to_bytes()
Posted by Andy Shevchenko 8 months ago
On Thu, Apr 17, 2025 at 10:30:46AM -0500, David Lechner wrote:
> On 4/17/25 10:24 AM, Andy Shevchenko wrote:
> > Recently in the discussion with David the idea of having
> > a common helper popped up. The helper converts the given
> > bits per word to bytes. The result will always be power-of-two
> > (e.g. for 37 bits it returns 8 bytes) or 0 for 0 input.
> > More details are in the respective code comment.
> > 
> > This mini-series introduces it and replaces current users
> > under drivers/spi and we expect more (and possibly some
> > lurking in other subsystems).
> > 
> > Mark, if you okay with the idea, please, make this to be
> > an immutable branch or tag for others to pull.
> > 
> > In v3:
> > - fixed the typos in the examples
> > 
> > In v2:
> > - improved examples in the code comment and commit message (David)
> 
> Reviewed-by: David Lechner <dlechner@baylibre.com>

Thank you for the review!

-- 
With Best Regards,
Andy Shevchenko