All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-linux-intel-lts:5.10/yocto 10656/15115] drivers/media/i2c/lt6911uxc.c:787:21: sparse: sparse: Using plain integer as NULL pointer
@ 2021-08-22  3:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-22  3:25 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 8328 bytes --]

tree:   https://github.com/intel/linux-intel-lts.git 5.10/yocto
head:   a70bb6a927c84079200a53c29462319293d3df1d
commit: 367a342a05c249be8a0ea5e9d1e9dd5669a02abf [10656/15115] media: lt6911uxc:add sensor driver
config: alpha-randconfig-s031-20210813 (attached as .config)
compiler: alpha-linux-gcc (GCC) 10.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-348-gf0e6938b-dirty
        # https://github.com/intel/linux-intel-lts/commit/367a342a05c249be8a0ea5e9d1e9dd5669a02abf
        git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
        git fetch --no-tags intel-linux-intel-lts 5.10/yocto
        git checkout 367a342a05c249be8a0ea5e9d1e9dd5669a02abf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash drivers/media/i2c/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/media/i2c/lt6911uxc.c:787:21: sparse: sparse: Using plain integer as NULL pointer
   drivers/media/i2c/lt6911uxc.c:1134:10: sparse: sparse: Initializer entry defined twice
   drivers/media/i2c/lt6911uxc.c:1140:10: sparse:   also defined here

vim +787 drivers/media/i2c/lt6911uxc.c

   717	
   718	static int lt6911uxc_init_controls(struct lt6911uxc_state *lt6911uxc)
   719	{
   720		struct i2c_client *client = v4l2_get_subdevdata(&lt6911uxc->sd);
   721		struct v4l2_ctrl_handler *ctrl_hdlr;
   722		s64 hblank;
   723		struct v4l2_ctrl_config cfg = { 0 };
   724		int ret;
   725	
   726		ctrl_hdlr = &lt6911uxc->ctrl_handler;
   727		ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8);
   728		if (ret)
   729			return ret;
   730	
   731		ctrl_hdlr->lock = &lt6911uxc->mutex;
   732		lt6911uxc->link_freq =
   733			v4l2_ctrl_new_int_menu(ctrl_hdlr,
   734				&lt6911uxc_ctrl_ops,
   735				V4L2_CID_LINK_FREQ,
   736				sizeof(lt6911uxc->cur_mode->pixel_clk),
   737				0, (s64 *)&lt6911uxc->cur_mode->pixel_clk);
   738		if (ctrl_hdlr->error) {
   739			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   740				ctrl_hdlr->error);
   741			return ctrl_hdlr->error;
   742		}
   743		if (lt6911uxc->link_freq)
   744			lt6911uxc->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
   745	
   746		lt6911uxc->vblank = v4l2_ctrl_new_std(ctrl_hdlr,
   747					&lt6911uxc_ctrl_ops,
   748					V4L2_CID_VBLANK, 0, 1, 1, 1);
   749		if (ctrl_hdlr->error) {
   750			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   751				ctrl_hdlr->error);
   752			return ctrl_hdlr->error;
   753		}
   754	
   755		lt6911uxc->analogue_gain = v4l2_ctrl_new_std(ctrl_hdlr,
   756				&lt6911uxc_ctrl_ops,
   757				V4L2_CID_ANALOGUE_GAIN, 0, 1, 1, 1);
   758		if (ctrl_hdlr->error) {
   759			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   760				ctrl_hdlr->error);
   761			return ctrl_hdlr->error;
   762		}
   763	
   764		lt6911uxc->digital_gain = v4l2_ctrl_new_std(ctrl_hdlr,
   765				&lt6911uxc_ctrl_ops,
   766				V4L2_CID_DIGITAL_GAIN,	0, 1, 1, 1);
   767		if (ctrl_hdlr->error) {
   768			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   769				ctrl_hdlr->error);
   770			return ctrl_hdlr->error;
   771		}
   772	
   773		lt6911uxc->exposure = v4l2_ctrl_new_std(ctrl_hdlr,
   774					&lt6911uxc_ctrl_ops,
   775					V4L2_CID_EXPOSURE, 0, 1, 1, 1);
   776		if (ctrl_hdlr->error) {
   777			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   778				ctrl_hdlr->error);
   779			return ctrl_hdlr->error;
   780		}
   781	
   782		cfg.ops = &lt6911uxc_ctrl_ops;
   783		cfg.id = V4L2_CID_MIPI_LANES;
   784		cfg.name = "V4L2_CID_MIPI_LANES";
   785		cfg.type = V4L2_CTRL_TYPE_INTEGER;
   786		cfg.max = 4; cfg.min = 2; cfg.step = 2; cfg.def = 4;
 > 787		cfg.qmenu = 0; cfg.elem_size = 0;
   788		lt6911uxc->mipi_lanes = v4l2_ctrl_new_custom(ctrl_hdlr, &cfg, NULL);
   789		if (ctrl_hdlr->error) {
   790			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   791				ctrl_hdlr->error);
   792			return ctrl_hdlr->error;
   793		}
   794	
   795		lt6911uxc_csi_port.def = lt6911uxc->platform_data->port;
   796		lt6911uxc->csi_port =
   797			v4l2_ctrl_new_custom(ctrl_hdlr, &lt6911uxc_csi_port, NULL);
   798		if (ctrl_hdlr->error) {
   799			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   800				ctrl_hdlr->error);
   801			return ctrl_hdlr->error;
   802		}
   803	
   804		lt6911uxc_i2c_bus.def = i2c_adapter_id(client->adapter);
   805		lt6911uxc->i2c_bus =
   806			v4l2_ctrl_new_custom(ctrl_hdlr, &lt6911uxc_i2c_bus, NULL);
   807		if (ctrl_hdlr->error) {
   808			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   809				ctrl_hdlr->error);
   810			return ctrl_hdlr->error;
   811		}
   812	
   813		lt6911uxc_i2c_id.def = client->addr;
   814		lt6911uxc->i2c_id = v4l2_ctrl_new_custom(ctrl_hdlr,
   815					&lt6911uxc_i2c_id, NULL);
   816		if (ctrl_hdlr->error) {
   817			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   818				ctrl_hdlr->error);
   819			return ctrl_hdlr->error;
   820		}
   821	
   822		lt6911uxc_i2c_slave_address.def =
   823			lt6911uxc->platform_data->i2c_slave_address;
   824		lt6911uxc->i2c_slave_address = v4l2_ctrl_new_custom(ctrl_hdlr,
   825						&lt6911uxc_i2c_slave_address, NULL);
   826		if (ctrl_hdlr->error) {
   827			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   828				ctrl_hdlr->error);
   829			return ctrl_hdlr->error;
   830		}
   831	
   832		lt6911uxc_fps.def = lt6911uxc->cur_mode->fps;
   833		lt6911uxc->fps = v4l2_ctrl_new_custom(ctrl_hdlr, &lt6911uxc_fps, NULL);
   834		if (ctrl_hdlr->error) {
   835			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   836				ctrl_hdlr->error);
   837			return ctrl_hdlr->error;
   838		}
   839	
   840		lt6911uxc_frame_interval.def = 1000 / lt6911uxc->cur_mode->fps;
   841		lt6911uxc->frame_interval = v4l2_ctrl_new_custom(ctrl_hdlr,
   842						&lt6911uxc_frame_interval, NULL);
   843		if (ctrl_hdlr->error) {
   844			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   845				ctrl_hdlr->error);
   846			return ctrl_hdlr->error;
   847		}
   848	
   849		lt6911uxc->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr,
   850					&lt6911uxc_ctrl_ops,
   851					V4L2_CID_PIXEL_RATE,
   852					get_pixel_rate(lt6911uxc),
   853					get_pixel_rate(lt6911uxc), 1,
   854					get_pixel_rate(lt6911uxc));
   855		if (ctrl_hdlr->error) {
   856			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   857				ctrl_hdlr->error);
   858			return ctrl_hdlr->error;
   859		}
   860		if (lt6911uxc->pixel_rate)
   861			lt6911uxc->pixel_rate->flags |= V4L2_CTRL_FLAG_READ_ONLY;
   862	
   863		hblank = 1;
   864		lt6911uxc->hblank = v4l2_ctrl_new_std(ctrl_hdlr,
   865					&lt6911uxc_ctrl_ops,
   866					V4L2_CID_HBLANK, 0, 1, 1, 1);
   867		if (ctrl_hdlr->error) {
   868			dev_dbg(&client->dev, "Set ctrl_hdlr, err=%d.\n",
   869				ctrl_hdlr->error);
   870			return ctrl_hdlr->error;
   871		}
   872		if (lt6911uxc->hblank)
   873			lt6911uxc->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
   874	
   875		/* custom v4l2 audio controls */
   876		lt6911uxc->audio_sampling_rate_ctrl = v4l2_ctrl_new_custom(
   877			ctrl_hdlr, &lt6911uxc_ctrl_audio_sampling_rate, NULL);
   878		if (ctrl_hdlr->error) {
   879			dev_dbg(&client->dev, "Set audio sampling rate ctrl, err=%d.\n",
   880				 ctrl_hdlr->error);
   881			return ctrl_hdlr->error;
   882		}
   883		lt6911uxc->audio_present_ctrl = v4l2_ctrl_new_custom(ctrl_hdlr,
   884			&lt6911uxc_ctrl_audio_present, NULL);
   885		if (ctrl_hdlr->error) {
   886			dev_dbg(&client->dev, "Set audio present ctrl, error = %d.\n",
   887				ctrl_hdlr->error);
   888			return ctrl_hdlr->error;
   889		}
   890	
   891		lt6911uxc->sd.ctrl_handler = ctrl_hdlr;
   892		return 0;
   893	}
   894	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36110 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-22  3:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22  3:25 [intel-linux-intel-lts:5.10/yocto 10656/15115] drivers/media/i2c/lt6911uxc.c:787:21: sparse: sparse: Using plain integer as NULL pointer kernel test robot

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.