mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
mtd: spi-nor: spansion: make sure local struct does not contain garbage
Following errors were seen with um-x86_64-gcc12/um-allyesconfig: + /kisskb/src/drivers/mtd/spi-nor/spansion.c: error: 'op' is used uninitialized [-Werror=uninitialized]: => 495:27, 364:27 Initialise local struct spi_mem_op with all zeros at declaration in order to avoid using garbage data for fields that are not explicitly set afterwards. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Fixes:c87c9b11c5
("mtd: spi-nor: spansion: Determine current address mode") Fixes:6afcc84080
("mtd: spi-nor: spansion: Add support for Infineon S25FS256T") Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230509193900.948753-1-tudor.ambarus@linaro.org
This commit is contained in:
parent
44c026a73b
commit
420c4495b5
1 changed files with 2 additions and 2 deletions
|
@ -361,7 +361,7 @@ static int cypress_nor_determine_addr_mode_by_sr1(struct spi_nor *nor,
|
||||||
*/
|
*/
|
||||||
static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
|
static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
|
||||||
{
|
{
|
||||||
struct spi_mem_op op;
|
struct spi_mem_op op = {};
|
||||||
u8 addr_mode;
|
u8 addr_mode;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ s25fs256t_post_bfpt_fixup(struct spi_nor *nor,
|
||||||
const struct sfdp_parameter_header *bfpt_header,
|
const struct sfdp_parameter_header *bfpt_header,
|
||||||
const struct sfdp_bfpt *bfpt)
|
const struct sfdp_bfpt *bfpt)
|
||||||
{
|
{
|
||||||
struct spi_mem_op op;
|
struct spi_mem_op op = {};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = cypress_nor_set_addr_mode_nbytes(nor);
|
ret = cypress_nor_set_addr_mode_nbytes(nor);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue