Re: [PATCH] powerpc/sparse: fix plain integer as NULL pointer warning

2018-04-13 Thread kbuild test robot
Hi Mathieu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on v4.16 next-20180413]
[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/Mathieu-Malaterre/powerpc-sparse-fix-plain-integer-as-NULL-pointer-warning/20180413-144954
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 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=powerpc 

All warnings (new ones prefixed by >>):

   drivers/macintosh/via-pmu.c: In function 'pmu_present':
>> drivers/macintosh/via-pmu.c:1752:9: warning: return makes integer from 
>> pointer without a cast [-Wint-conversion]
 return via;
^~~

vim +1752 drivers/macintosh/via-pmu.c

  1748  
  1749  int
  1750  pmu_present(void)
  1751  {
> 1752  return via;
  1753  }
  1754  

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


.config.gz
Description: application/gzip


[PATCH] powerpc/sparse: fix plain integer as NULL pointer warning

2018-04-12 Thread Mathieu Malaterre
Trivial fix to remove the following sparse warnings:

  arch/powerpc/kernel/module_32.c:112:74: warning: Using plain integer as NULL 
pointer
  arch/powerpc/kernel/module_32.c:117:74: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:1155:28: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:1230:20: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:1385:36: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:1752:23: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:2084:19: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:2110:32: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:2167:19: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:2183:19: warning: Using plain integer as NULL 
pointer
  drivers/macintosh/via-pmu.c:277:20: warning: Using plain integer as NULL 
pointer
  arch/powerpc/platforms/powermac/setup.c:155:67: warning: Using plain integer 
as NULL pointer
  arch/powerpc/platforms/powermac/setup.c:247:27: warning: Using plain integer 
as NULL pointer
  arch/powerpc/platforms/powermac/setup.c:249:27: warning: Using plain integer 
as NULL pointer
  arch/powerpc/platforms/powermac/setup.c:252:37: warning: Using plain integer 
as NULL pointer
  arch/powerpc/mm/tlb_hash32.c:127:21: warning: Using plain integer as NULL 
pointer
  arch/powerpc/mm/tlb_hash32.c:148:21: warning: Using plain integer as NULL 
pointer
  arch/powerpc/mm/tlb_hash32.c:44:21: warning: Using plain integer as NULL 
pointer
  arch/powerpc/mm/tlb_hash32.c:57:21: warning: Using plain integer as NULL 
pointer
  arch/powerpc/mm/tlb_hash32.c:87:21: warning: Using plain integer as NULL 
pointer
  arch/powerpc/kernel/btext.c:160:31: warning: Using plain integer as NULL 
pointer
  arch/powerpc/kernel/btext.c:167:22: warning: Using plain integer as NULL 
pointer
  arch/powerpc/kernel/btext.c:274:21: warning: Using plain integer as NULL 
pointer
  arch/powerpc/kernel/btext.c:285:31: warning: Using plain integer as NULL 
pointer
  arch/powerpc/include/asm/hugetlb.h:204:16: warning: Using plain integer as 
NULL pointer
  arch/powerpc/mm/ppc_mmu_32.c:170:21: warning: Using plain integer as NULL 
pointer
  arch/powerpc/platforms/powermac/pci.c:1227:23: warning: Using plain integer 
as NULL pointer
  arch/powerpc/platforms/powermac/pci.c:65:24: warning: Using plain integer as 
NULL pointer

Also use `--fix` command line option from `script/checkpatch --strict` to
remove the following:

  CHECK: Comparison to NULL could be written "!dispDeviceBase"
  #72: FILE: arch/powerpc/kernel/btext.c:160:
  + if (dispDeviceBase == NULL)

  CHECK: Comparison to NULL could be written "!vbase"
  #80: FILE: arch/powerpc/kernel/btext.c:167:
  + if (vbase == NULL)

  CHECK: Comparison to NULL could be written "!base"
  #89: FILE: arch/powerpc/kernel/btext.c:274:
  + if (base == NULL)

  CHECK: Comparison to NULL could be written "!dispDeviceBase"
  #98: FILE: arch/powerpc/kernel/btext.c:285:
  + if (dispDeviceBase == NULL)

  CHECK: Comparison to NULL could be written "strstr"
  #117: FILE: arch/powerpc/kernel/module_32.c:117:
  + if (strstr(secstrings + sechdrs[i].sh_name, ".debug") != NULL)

  CHECK: Comparison to NULL could be written "!Hash"
  #130: FILE: arch/powerpc/mm/ppc_mmu_32.c:170:
  + if (Hash == NULL)

  CHECK: Comparison to NULL could be written "Hash"
  #143: FILE: arch/powerpc/mm/tlb_hash32.c:44:
  + if (Hash != NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  #152: FILE: arch/powerpc/mm/tlb_hash32.c:57:
  + if (Hash == NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  #161: FILE: arch/powerpc/mm/tlb_hash32.c:87:
  + if (Hash == NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  #170: FILE: arch/powerpc/mm/tlb_hash32.c:127:
  + if (Hash == NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  #179: FILE: arch/powerpc/mm/tlb_hash32.c:148:
  + if (Hash == NULL) {

  ERROR: space required after that ';' (ctx:VxV)
  #192: FILE: arch/powerpc/platforms/powermac/pci.c:65:
  + for (; node != NULL;node = node->sibling) {

  CHECK: Comparison to NULL could be written "node"
  #192: FILE: arch/powerpc/platforms/powermac/pci.c:65:
  + for (; node != NULL;node = node->sibling) {

  CHECK: Comparison to NULL could be written "!region"
  #201: FILE: arch/powerpc/platforms/powermac/pci.c:1227:
  + if (region == NULL)

  CHECK: Comparison to NULL could be written "of_get_property"
  #214: FILE: arch/powerpc/platforms/powermac/setup.c:155:
  + if (of_get_property(np, "cache-unified", NULL) != NULL && dc) {

  CHECK: Comparison to NULL could be written "!np"
  #223: FILE: arch/powerpc/platforms/powermac/setup.c:247:
  + if (np == NULL)

  CHECK: Comparison to NULL could be written "np"
  #226: FILE: