* [ragnatech:media-tree 359/359] drivers/media/i2c/imx334.c:793:55: warning: variable 'ret' is uninitialized when used here
@ 2021-02-09 3:59 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-09 3:59 UTC (permalink / raw)
To: Martina Krasteva
Cc: kbuild-all, clang-built-linux, Mauro Carvalho Chehab,
linux-media, Gjorgji Rosikopulos, Jacopo Mondi, Sakari Ailus
[-- Attachment #1: Type: text/plain, Size: 4312 bytes --]
tree: git://git.ragnatech.se/linux media-tree
head: 9746b11715c3949241e2d88cb9057da4adab7e02
commit: 9746b11715c3949241e2d88cb9057da4adab7e02 [359/359] media: i2c: Add imx334 camera sensor driver
config: arm64-randconfig-r022-20210209 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add ragnatech git://git.ragnatech.se/linux
git fetch --no-tags ragnatech media-tree
git checkout 9746b11715c3949241e2d88cb9057da4adab7e02
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/media/i2c/imx334.c:793:55: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
dev_err(imx334->dev, "failed to get reset gpio %d", ret);
^~~
include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
drivers/media/i2c/imx334.c:783:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +/ret +793 drivers/media/i2c/imx334.c
768
769 /**
770 * imx334_parse_hw_config() - Parse HW configuration and check if supported
771 * @imx334: pointer to imx334 device
772 *
773 * Return: 0 if successful, error code otherwise.
774 */
775 static int imx334_parse_hw_config(struct imx334 *imx334)
776 {
777 struct fwnode_handle *fwnode = dev_fwnode(imx334->dev);
778 struct v4l2_fwnode_endpoint bus_cfg = {
779 .bus_type = V4L2_MBUS_CSI2_DPHY
780 };
781 struct fwnode_handle *ep;
782 unsigned long rate;
783 int ret;
784 int i;
785
786 if (!fwnode)
787 return -ENXIO;
788
789 /* Request optional reset pin */
790 imx334->reset_gpio = devm_gpiod_get_optional(imx334->dev, "reset",
791 GPIOD_OUT_LOW);
792 if (IS_ERR(imx334->reset_gpio)) {
> 793 dev_err(imx334->dev, "failed to get reset gpio %d", ret);
794 return PTR_ERR(imx334->reset_gpio);
795 }
796
797 /* Get sensor input clock */
798 imx334->inclk = devm_clk_get(imx334->dev, NULL);
799 if (IS_ERR(imx334->inclk)) {
800 dev_err(imx334->dev, "could not get inclk");
801 return PTR_ERR(imx334->inclk);
802 }
803
804 rate = clk_get_rate(imx334->inclk);
805 if (rate != IMX334_INCLK_RATE) {
806 dev_err(imx334->dev, "inclk frequency mismatch");
807 return -EINVAL;
808 }
809
810 ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
811 if (!ep)
812 return -ENXIO;
813
814 ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
815 fwnode_handle_put(ep);
816 if (ret)
817 return ret;
818
819 if (bus_cfg.bus.mipi_csi2.num_data_lanes != IMX334_NUM_DATA_LANES) {
820 dev_err(imx334->dev,
821 "number of CSI2 data lanes %d is not supported",
822 bus_cfg.bus.mipi_csi2.num_data_lanes);
823 ret = -EINVAL;
824 goto done_endpoint_free;
825 }
826
827 if (!bus_cfg.nr_of_link_frequencies) {
828 dev_err(imx334->dev, "no link frequencies defined");
829 ret = -EINVAL;
830 goto done_endpoint_free;
831 }
832
833 for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++)
834 if (bus_cfg.link_frequencies[i] == IMX334_LINK_FREQ)
835 goto done_endpoint_free;
836
837 ret = -EINVAL;
838
839 done_endpoint_free:
840 v4l2_fwnode_endpoint_free(&bus_cfg);
841
842 return ret;
843 }
844
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45066 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-09 4:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 3:59 [ragnatech:media-tree 359/359] drivers/media/i2c/imx334.c:793:55: warning: variable 'ret' is uninitialized when used here kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).