From: kernel test robot <lkp@intel.com>
To: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Tudor Ambarus <tudor.ambarus@linaro.org>
Subject: [ambarus:spi-nor/next 9/15] drivers/mtd/spi-nor/spansion.c:928:4: warning: variable 'priv' is uninitialized when used here
Date: Tue, 18 Jul 2023 15:09:01 +0800 [thread overview]
Message-ID: <202307181511.GuBLaRAf-lkp@intel.com> (raw)
tree: https://github.com/ambarus/linux-0day spi-nor/next
head: 665be09f5a5735bb5dcb60043890682e20ac382f
commit: 8c49ad2ebb7ae23fef6859d3f326e82b8789fc09 [9/15] mtd: spi-nor: spansion: use CLPEF as an alternative to CLSR
config: i386-randconfig-i014-20230718 (https://download.01.org/0day-ci/archive/20230718/202307181511.GuBLaRAf-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230718/202307181511.GuBLaRAf-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307181511.GuBLaRAf-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/mtd/spi-nor/spansion.c:928:4: warning: variable 'priv' is uninitialized when used here [-Wuninitialized]
priv->clsr = SPINOR_OP_CLSR;
^~~~
drivers/mtd/spi-nor/spansion.c:911:34: note: initialize the variable 'priv' to silence this warning
struct spansion_nor_params *priv;
^
= NULL
1 warning generated.
vim +/priv +928 drivers/mtd/spi-nor/spansion.c
907
908 static int spansion_nor_late_init(struct spi_nor *nor)
909 {
910 struct spi_nor_flash_parameter *params = nor->params;
911 struct spansion_nor_params *priv;
912 u8 mfr_flags = nor->info->mfr_flags;
913
914 if (params->size > SZ_16M) {
915 nor->flags |= SNOR_F_4B_OPCODES;
916 /* No small sector erase for 4-byte command set */
917 nor->erase_opcode = SPINOR_OP_SE;
918 nor->mtd.erasesize = nor->info->sector_size;
919 }
920
921 if (mfr_flags & (USE_CLSR | USE_CLPEF)) {
922 params->priv = devm_kmalloc(nor->dev, sizeof(*priv),
923 GFP_KERNEL);
924 if (!params->priv)
925 return -ENOMEM;
926
927 if (mfr_flags & USE_CLSR)
> 928 priv->clsr = SPINOR_OP_CLSR;
929 else if (mfr_flags & USE_CLPEF)
930 priv->clsr = SPINOR_OP_CLPEF;
931
932 nor->params->ready = spansion_nor_sr_ready_and_clear;
933 }
934
935 return 0;
936 }
937
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-07-18 7:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202307181511.GuBLaRAf-lkp@intel.com \
--to=lkp@intel.com \
--cc=Takahiro.Kuwano@infineon.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tudor.ambarus@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.