[<prev] [next>] [day] [month] [year] [list]
Message-ID: <DB6P189MB0568F3BE9384315F5C8C1A3E9CA49@DB6P189MB0568.EURP189.PROD.OUTLOOK.COM>
Date: Mon, 20 Feb 2023 17:05:52 +0000
From: David Binderman <dcb314@...mail.com>
To: "broonie@...nel.org" <broonie@...nel.org>,
"linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: possible bug in linux-6.2/drivers/spi/spi-sn-f-ospi.c
Hello there,
Static analyser cppcheck says:
linux-6.2/drivers/spi/spi-sn-f-ospi.c:614:31: style: Same expression 'SPI_TX_OCTAL' found multiple times in chain of '|' operators. [duplicateExpression]
Source code is
ctlr->mode_bits = SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL
| SPI_RX_DUAL | SPI_RX_QUAD | SPI_TX_OCTAL
| SPI_MODE_0 | SPI_MODE_1 | SPI_LSB_FIRST;
Maybe better code:
ctlr->mode_bits = SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL
| SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL
| SPI_MODE_0 | SPI_MODE_1 | SPI_LSB_FIRST;
Regards
David Binderman
Powered by blists - more mailing lists