Re: [PATCH v2] saa7164: Fix driver name in debug output

2018-05-04 Thread kbuild test robot
Hi Brad,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.17-rc3 next-20180504]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Brad-Love/saa7164-Fix-driver-name-in-debug-output/20180504-114908
base:   git://linuxtv.org/media_tree.git master
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/media/pci/saa7164/saa7164-fw.c: In function 
'saa7164_downloadfirmware':
>> drivers/media/pci/saa7164/saa7164-fw.c:429:11: warning: format '%ld' expects 
>> argument of type 'long int', but argument 2 has type 'size_t {aka const 
>> unsigned int}' [-Wformat=]
   printk(KERN_ERR "saa7164: firmware incorrect size %ld != %u\n",
  ^~
fw->size, fwlength);


vim +429 drivers/media/pci/saa7164/saa7164-fw.c

   195  
   196  /* TODO: Excessive debug */
   197  /* Load the firmware. Optionally it can be in ROM or newer versions
   198   * can be on disk, saving the expense of the ROM hardware. */
   199  int saa7164_downloadfirmware(struct saa7164_dev *dev)
   200  {
   201  /* u32 second_timeout = 60 * SAA_DEVICE_TIMEOUT; */
   202  u32 tmp, filesize, version, err_flags, first_timeout, fwlength;
   203  u32 second_timeout, updatebootloader = 1, bootloadersize = 0;
   204  const struct firmware *fw = NULL;
   205  struct fw_header *hdr, *boothdr = NULL, *fwhdr;
   206  u32 bootloaderversion = 0, fwloadersize;
   207  u8 *bootloaderoffset = NULL, *fwloaderoffset;
   208  char *fwname;
   209  int ret;
   210  
   211  dprintk(DBGLVL_FW, "%s()\n", __func__);
   212  
   213  if (saa7164_boards[dev->board].chiprev == SAA7164_CHIP_REV2) {
   214  fwname = SAA7164_REV2_FIRMWARE;
   215  fwlength = SAA7164_REV2_FIRMWARE_SIZE;
   216  } else {
   217  fwname = SAA7164_REV3_FIRMWARE;
   218  fwlength = SAA7164_REV3_FIRMWARE_SIZE;
   219  }
   220  
   221  version = saa7164_getcurrentfirmwareversion(dev);
   222  
   223  if (version == 0x00) {
   224  
   225  second_timeout = 100;
   226  first_timeout = 100;
   227  err_flags = saa7164_readl(SAA_BOOTLOADERERROR_FLAGS);
   228  dprintk(DBGLVL_FW, "%s() err_flags = %x\n",
   229  __func__, err_flags);
   230  
   231  while (err_flags != SAA_DEVICE_IMAGE_BOOTING) {
   232  dprintk(DBGLVL_FW, "%s() err_flags = %x\n",
   233  __func__, err_flags);
   234  msleep(10); /* Checkpatch throws a < 20ms 
warning */
   235  
   236  if (err_flags & SAA_DEVICE_IMAGE_CORRUPT) {
   237  printk(KERN_ERR "%s() firmware 
corrupt\n",
   238  __func__);
   239  break;
   240  }
   241  if (err_flags & SAA_DEVICE_MEMORY_CORRUPT) {
   242  printk(KERN_ERR "%s() device memory 
corrupt\n",
   243  __func__);
   244  break;
   245  }
   246  if (err_flags & SAA_DEVICE_NO_IMAGE) {
   247  printk(KERN_ERR "%s() no first image\n",
   248  __func__);
   249  break;
   250  }
   251  if (err_flags & SAA_DEVICE_IMAGE_SEARCHING) {
   252  first_timeout -= 10;
   253  if (first_timeout == 0) {
   254  printk(KERN_ERR
   255  "%s() no first image\n",
   256  __func__);
   257  break;
   258  }
   259  } else if (err_flags & 
SAA_DEVICE_IMAGE_LOADING) {
   260  second_timeout -= 10;
   261  if (second_timeout == 0) {
   262  printk(KERN_ERR
   263  "%s() FW load time exceeded\n",
   264  __func__);
   265  break;
   266  }
   267  

Re: [PATCH v2] saa7164: Fix driver name in debug output

2018-05-04 Thread kbuild test robot
Hi Brad,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.17-rc3 next-20180503]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Brad-Love/saa7164-Fix-driver-name-in-debug-output/20180504-114908
base:   git://linuxtv.org/media_tree.git master
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:14,
from include/asm-generic/bug.h:18,
from ./arch/xtensa/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/firmware.h:7,
from drivers/media//pci/saa7164/saa7164-fw.c:18:
   drivers/media//pci/saa7164/saa7164-fw.c: In function 
'saa7164_downloadfirmware':
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of 
>> type 'long int', but argument 2 has type 'size_t {aka const unsigned int}' 
>> [-Wformat=]
#define KERN_SOH "\001"  /* ASCII Start Of Header */
 ^
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
#define KERN_ERR KERN_SOH "3" /* error conditions */
 ^~~~
   drivers/media//pci/saa7164/saa7164-fw.c:429:11: note: in expansion of macro 
'KERN_ERR'
   printk(KERN_ERR "saa7164: firmware incorrect size %ld != %u\n",
  ^~~~
   drivers/media//pci/saa7164/saa7164-fw.c:429:56: note: format string is 
defined here
   printk(KERN_ERR "saa7164: firmware incorrect size %ld != %u\n",
 ~~^
 %d
--
   In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:14,
from include/asm-generic/bug.h:18,
from ./arch/xtensa/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/firmware.h:7,
from drivers/media/pci/saa7164/saa7164-fw.c:18:
   drivers/media/pci/saa7164/saa7164-fw.c: In function 
'saa7164_downloadfirmware':
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of 
>> type 'long int', but argument 2 has type 'size_t {aka const unsigned int}' 
>> [-Wformat=]
#define KERN_SOH "\001"  /* ASCII Start Of Header */
 ^
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
#define KERN_ERR KERN_SOH "3" /* error conditions */
 ^~~~
   drivers/media/pci/saa7164/saa7164-fw.c:429:11: note: in expansion of macro 
'KERN_ERR'
   printk(KERN_ERR "saa7164: firmware incorrect size %ld != %u\n",
  ^~~~
   drivers/media/pci/saa7164/saa7164-fw.c:429:56: note: format string is 
defined here
   printk(KERN_ERR "saa7164: firmware incorrect size %ld != %u\n",
 ~~^
 %d

vim +5 include/linux/kern_levels.h

314ba352 Joe Perches 2012-07-30  4  
04d2c8c8 Joe Perches 2012-07-30 @5  #define KERN_SOH"\001"  /* 
ASCII Start Of Header */
04d2c8c8 Joe Perches 2012-07-30  6  #define KERN_SOH_ASCII  '\001'
04d2c8c8 Joe Perches 2012-07-30  7  

:: The code at line 5 was first introduced by commit
:: 04d2c8c83d0e3ac5f78aeede51babb3236200112 printk: convert the format for 
KERN_ to a 2 byte pattern

:: TO: Joe Perches 
:: CC: Linus Torvalds 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH v2] saa7164: Fix driver name in debug output

2018-05-03 Thread Brad Love
This issue was reported by a user who downloaded a corrupt saa7164
firmware, then went looking for a valid xc5000 firmware to fix the
error displayed...but the device in question has no xc5000, thus after
much effort, the wild goose chase eventually led to a support call.

The xc5000 has nothing to do with saa7164 (as far as I can tell),
so replace the string with saa7164 as well as give a meaningful
hint on the firmware mismatch.

Signed-off-by: Brad Love 
---
Since v1:
- Appease the 0-day bot, fix print format related kernel warnings.

 drivers/media/pci/saa7164/saa7164-fw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/pci/saa7164/saa7164-fw.c 
b/drivers/media/pci/saa7164/saa7164-fw.c
index ef49064..ee65ea8 100644
--- a/drivers/media/pci/saa7164/saa7164-fw.c
+++ b/drivers/media/pci/saa7164/saa7164-fw.c
@@ -426,7 +426,8 @@ int saa7164_downloadfirmware(struct saa7164_dev *dev)
__func__, fw->size);
 
if (fw->size != fwlength) {
-   printk(KERN_ERR "xc5000: firmware incorrect size\n");
+   printk(KERN_ERR "saa7164: firmware incorrect size %ld 
!= %u\n",
+   fw->size, fwlength);
ret = -ENOMEM;
goto out;
}
-- 
2.7.4