Re: [PATCH 08/11] media: adv7842: better document EDID block size
From: kernel test robot
Date: Thu Jun 17 2021 - 04:17:02 EST
Hi Mauro,
I love your patch! Yet something to improve:
[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on next-20210616]
[cannot apply to v5.13-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/Address-some-smatch-warnings/20210617-091510
base: git://linuxtv.org/media_tree.git master
config: alpha-randconfig-r025-20210617 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/3bdf84a7467fed26b64ffe547f5989d73060a30e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mauro-Carvalho-Chehab/Address-some-smatch-warnings/20210617-091510
git checkout 3bdf84a7467fed26b64ffe547f5989d73060a30e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All error/warnings (new ones prefixed by >>):
drivers/media/i2c/adv7842.c: In function 'edid_write_vga_segment':
>> drivers/media/i2c/adv7842.c:739:19: warning: comparison between pointer and integer
739 | for (i = 0; && i < blocks * EDID_BLOCK_SIZE; i += I2C_SMBUS_BLOCK_MAX) {
| ^
>> drivers/media/i2c/adv7842.c:739:2: error: label 'i' used but not defined
739 | for (i = 0; && i < blocks * EDID_BLOCK_SIZE; i += I2C_SMBUS_BLOCK_MAX) {
| ^~~
vim +/i +739 drivers/media/i2c/adv7842.c
715
716 static int edid_write_vga_segment(struct v4l2_subdev *sd)
717 {
718 struct i2c_client *client = v4l2_get_subdevdata(sd);
719 struct adv7842_state *state = to_state(sd);
720 const u8 *edid = state->vga_edid.edid;
721 u32 blocks = state->vga_edid.blocks;
722 int err = 0;
723 int i;
724
725 v4l2_dbg(2, debug, sd, "%s: write EDID on VGA port\n", __func__);
726
727 if (!state->vga_edid.present)
728 return 0;
729
730 /* HPA disable on port A and B */
731 io_write_and_or(sd, 0x20, 0xcf, 0x00);
732
733 /* Disable I2C access to internal EDID ram from VGA DDC port */
734 rep_write_and_or(sd, 0x7f, 0x7f, 0x00);
735
736 /* edid segment pointer '1' for VGA port */
737 rep_write_and_or(sd, 0x77, 0xef, 0x10);
738
> 739 for (i = 0; && i < blocks * EDID_BLOCK_SIZE; i += I2C_SMBUS_BLOCK_MAX) {
740 err = i2c_smbus_write_i2c_block_data(state->i2c_edid, i,
741 I2C_SMBUS_BLOCK_MAX,
742 edid + i);
743 if (err)
744 return err;
745 }
746
747 /* Calculates the checksums and enables I2C access
748 * to internal EDID ram from VGA DDC port.
749 */
750 rep_write_and_or(sd, 0x7f, 0x7f, 0x80);
751
752 for (i = 0; i < 1000; i++) {
753 if (rep_read(sd, 0x79) & 0x20)
754 break;
755 mdelay(1);
756 }
757 if (i == 1000) {
758 v4l_err(client, "error enabling edid on VGA port\n");
759 return -EIO;
760 }
761
762 /* enable hotplug after 200 ms */
763 schedule_delayed_work(&state->delayed_work_enable_hotplug, HZ / 5);
764
765 return 0;
766 }
767
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip