From: Alexandru Ardelean Date: Mon, 4 Jan 2021 14:31:03 +0000 (+0200) Subject: spi: stm32: update dev_dbg() print format for SPI params X-Git-Tag: accepted/tizen/unified/20230118.172025~7038^2~100^2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b835da61774d4482864bc081dfb428104842ad3;p=platform%2Fkernel%2Flinux-rpi.git spi: stm32: update dev_dbg() print format for SPI params 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 adds a double-negation operator to the bit-masks. Essentially, the important values for debugging are 0 or 1, while masking them directly would show 0 or BIT(x) values. This way, the type of the arguments are automatically re-cast. Fixes: f7005142dace ("spi: uapi: unify SPI modes into a single spi.h header") Reported-by: kernel test robot Reported-by: Stephen Rothwell Cc: Andy Shevchenko Signed-off-by: Alexandru Ardelean Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210104143103.56510-1-alexandru.ardelean@analog.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index 6017209..be0fb16 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -1028,10 +1028,10 @@ static int stm32_spi_prepare_msg(struct spi_master *master, clrb |= spi->cfg->regs->lsb_first.mask; dev_dbg(spi->dev, "cpol=%d cpha=%d lsb_first=%d cs_high=%d\n", - spi_dev->mode & SPI_CPOL, - spi_dev->mode & SPI_CPHA, - spi_dev->mode & SPI_LSB_FIRST, - spi_dev->mode & SPI_CS_HIGH); + !!(spi_dev->mode & SPI_CPOL), + !!(spi_dev->mode & SPI_CPHA), + !!(spi_dev->mode & SPI_LSB_FIRST), + !!(spi_dev->mode & SPI_CS_HIGH)); spin_lock_irqsave(&spi->lock, flags);