lkml.org 
[lkml]   [2021]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] spi: stm32: update dev_dbg() print format for SPI params
Date


> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
> Sent: Monday, January 4, 2021 3:51 PM
> To: Ardelean, Alexandru <alexandru.Ardelean@analog.com>
> Cc: linux-spi <linux-spi@vger.kernel.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; Mark Brown <broonie@kernel.org>; Stephen Rothwell
> <sfr@canb.auug.org.au>
> Subject: Re: [PATCH] spi: stm32: update dev_dbg() print format for SPI params
>
> [External]
>
> On Mon, Jan 4, 2021 at 10:55 AM Alexandru Ardelean
> <alexandru.ardelean@analog.com> wrote:
> >
> > With the introduction of the 'include/uapi/linux/spi/spi.h' header,
> > the type of the macros are enforced to 'unsigned long int' via the
> > _BITUL() macro.
> >
> > This causes some -Wformat warnings in the spi-stm32 driver.
> > This patch changes the printf() specifiers from '%d' to '%lu' to
> > accommodate for this change.
> >
> > Fixes: f7005142dace ("spi: uapi: unify SPI modes into a single spi.h
> > header")
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
>
> LKP also reported this before.
>

Ack;
Will add it

> ...
>
> > - dev_dbg(spi->dev, "cpol=%d cpha=%d lsb_first=%d cs_high=%d\n",
> > + dev_dbg(spi->dev, "cpol=%lu cpha=%lu lsb_first=%lu
> > + cs_high=%lu\n",
> > spi_dev->mode & SPI_CPOL,
> > spi_dev->mode & SPI_CPHA,
> > spi_dev->mode & SPI_LSB_FIRST,
>
> Wouldn't the output be a bit awful with all these?
>
> I think the proper fix is to add !! to each bit mask.

Fine by me

>
> --
> With Best Regards,
> Andy Shevchenko
\
 
 \ /
  Last update: 2021-01-04 15:15    [W:0.056 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site