[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2022-03-02 Thread kernel test robot
CC: kbuild-...@lists.01.org
BCC: l...@intel.com
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   fb184c4af9b9f4563e7a126219389986a71d5b5b
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   9 months ago
:: branch date: 19 hours ago
:: commit date: 9 months ago
config: arm-randconfig-m031-20220302 
(https://download.01.org/0day-ci/archive/20220302/202203022209.reyc0wot-...@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c1 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct module 
*mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   53   struct mod_plt_sec *pltsec = 
!in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   54   
  &mod->arch.init;
79f32b221b18c1 Alex Sverdlin  2021-05-05   55   struct plt_entries *plt;
79f32b221b18c1 Alex Sverdlin  2021-05-05   56   int idx;
79f32b221b18c1 Alex Sverdlin  2021-05-05   57  
79f32b221b18c1 Alex Sverdlin  2021-05-05   58   /* cache the address, ELF 
header is available only during module load */
79f32b221b18c1 Alex Sverdlin  2021-05-05   59   if (!pltsec->plt_ent)
79f32b221b18c1 Alex Sverdlin  2021-05-05   60   pltsec->plt_ent = 
(struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c1 Alex Sverdlin  2021-05-05   61   plt = pltsec->plt_ent;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   62  
79f32b221b18c1 Alex Sverdlin  2021-05-05   63   prealloc_fixed(pltsec, plt);
79f32b221b18c1 Alex Sverdlin  2021-05-05   64  
79f32b221b18c1 Alex Sverdlin  2021-05-05  @65   for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c1 Alex Sverdlin  2021-05-05   66   if (plt->lit[idx] == 
val)
79f32b221b18c1 Alex Sverdlin  2021-05-05   67   return 
(u32)&plt->ldr[idx];
35fa91eed817d2 Ard Biesheuvel 2016-08-16   68  
79f32b221b18c1 Alex Sverdlin  2021-05-05   69   idx = 0;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   70   /*
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   71* Look for an existing entry 
pointing to 'val'. Given that the
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   72* relocations are sorted, this 
will be the last entry we allocated.
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   73* (if one exists).
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   74*/
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   75   if (pltsec->plt_count > 0) {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   76   plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   77   idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   79   if (plt->lit[idx] == 
val)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   80   return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   82   idx = (idx + 1) % 
PLT_ENT_COUNT;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   83   if (!idx)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   84   plt++;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   85   }
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   87   pltsec->plt_count++;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   88   BUG_ON(pltsec->plt_count * 
PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   90   if (!idx)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   91   /* Populate a new set 
of entries */
7d485f647c1f4a Ard Biesheuvel 2014-11-24   92   *plt = (struct 
plt_entries){
7d485f647c1f4a Ard Biesheuvel 2014-11-24   93   { [0 ... 
PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a Ard Biesheuvel 2014-11-24   94   { val, }
7d485f647c1f4a Ard Biesheuvel 2014-11-24   95   };
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   96   else
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   97   plt->lit[idx] = val;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   99   return (u32)&plt->ldr[idx];
7d485f647c1f4a Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a Ard Biesheuvel 2014-11-24  101  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
___
kbuild mailing list -- kbuild@lists.01.or

[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2022-02-14 Thread kernel test robot
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   d567f5db412ed52de0b3b3efca4a451263de6108
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   8 months ago
:: branch date: 3 hours ago
:: commit date: 8 months ago
config: arm-randconfig-m031-20220214 
(https://download.01.org/0day-ci/archive/20220215/202202150457.oamwo3an-...@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c1 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct module 
*mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   53   struct mod_plt_sec *pltsec = 
!in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   54   
  &mod->arch.init;
79f32b221b18c1 Alex Sverdlin  2021-05-05   55   struct plt_entries *plt;
79f32b221b18c1 Alex Sverdlin  2021-05-05   56   int idx;
79f32b221b18c1 Alex Sverdlin  2021-05-05   57  
79f32b221b18c1 Alex Sverdlin  2021-05-05   58   /* cache the address, ELF 
header is available only during module load */
79f32b221b18c1 Alex Sverdlin  2021-05-05   59   if (!pltsec->plt_ent)
79f32b221b18c1 Alex Sverdlin  2021-05-05   60   pltsec->plt_ent = 
(struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c1 Alex Sverdlin  2021-05-05   61   plt = pltsec->plt_ent;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   62  
79f32b221b18c1 Alex Sverdlin  2021-05-05   63   prealloc_fixed(pltsec, plt);
79f32b221b18c1 Alex Sverdlin  2021-05-05   64  
79f32b221b18c1 Alex Sverdlin  2021-05-05  @65   for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c1 Alex Sverdlin  2021-05-05   66   if (plt->lit[idx] == 
val)
79f32b221b18c1 Alex Sverdlin  2021-05-05   67   return 
(u32)&plt->ldr[idx];
35fa91eed817d2 Ard Biesheuvel 2016-08-16   68  
79f32b221b18c1 Alex Sverdlin  2021-05-05   69   idx = 0;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   70   /*
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   71* Look for an existing entry 
pointing to 'val'. Given that the
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   72* relocations are sorted, this 
will be the last entry we allocated.
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   73* (if one exists).
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   74*/
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   75   if (pltsec->plt_count > 0) {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   76   plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   77   idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   79   if (plt->lit[idx] == 
val)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   80   return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   82   idx = (idx + 1) % 
PLT_ENT_COUNT;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   83   if (!idx)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   84   plt++;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   85   }
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   87   pltsec->plt_count++;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   88   BUG_ON(pltsec->plt_count * 
PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   90   if (!idx)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   91   /* Populate a new set 
of entries */
7d485f647c1f4a Ard Biesheuvel 2014-11-24   92   *plt = (struct 
plt_entries){
7d485f647c1f4a Ard Biesheuvel 2014-11-24   93   { [0 ... 
PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a Ard Biesheuvel 2014-11-24   94   { val, }
7d485f647c1f4a Ard Biesheuvel 2014-11-24   95   };
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   96   else
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   97   plt->lit[idx] = val;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   99   return (u32)&plt->ldr[idx];
7d485f647c1f4a Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a Ard Biesheuvel 2014-11-24  101  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
___
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send

[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2021-12-14 Thread kernel test robot
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   5472f14a37421d1bca3dddf33cabd3bd6dbefbbc
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   6 months ago
:: branch date: 17 hours ago
:: commit date: 6 months ago
config: arm-randconfig-m031-20211214 
(https://download.01.org/0day-ci/archive/20211214/202112142352.lfc1wryp-...@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c1 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct module 
*mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   53   struct mod_plt_sec *pltsec = 
!in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   54   
  &mod->arch.init;
79f32b221b18c1 Alex Sverdlin  2021-05-05   55   struct plt_entries *plt;
79f32b221b18c1 Alex Sverdlin  2021-05-05   56   int idx;
79f32b221b18c1 Alex Sverdlin  2021-05-05   57  
79f32b221b18c1 Alex Sverdlin  2021-05-05   58   /* cache the address, ELF 
header is available only during module load */
79f32b221b18c1 Alex Sverdlin  2021-05-05   59   if (!pltsec->plt_ent)
79f32b221b18c1 Alex Sverdlin  2021-05-05   60   pltsec->plt_ent = 
(struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c1 Alex Sverdlin  2021-05-05   61   plt = pltsec->plt_ent;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   62  
79f32b221b18c1 Alex Sverdlin  2021-05-05   63   prealloc_fixed(pltsec, plt);
79f32b221b18c1 Alex Sverdlin  2021-05-05   64  
79f32b221b18c1 Alex Sverdlin  2021-05-05  @65   for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c1 Alex Sverdlin  2021-05-05   66   if (plt->lit[idx] == 
val)
79f32b221b18c1 Alex Sverdlin  2021-05-05   67   return 
(u32)&plt->ldr[idx];
35fa91eed817d2 Ard Biesheuvel 2016-08-16   68  
79f32b221b18c1 Alex Sverdlin  2021-05-05   69   idx = 0;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   70   /*
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   71* Look for an existing entry 
pointing to 'val'. Given that the
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   72* relocations are sorted, this 
will be the last entry we allocated.
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   73* (if one exists).
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   74*/
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   75   if (pltsec->plt_count > 0) {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   76   plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   77   idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   79   if (plt->lit[idx] == 
val)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   80   return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   82   idx = (idx + 1) % 
PLT_ENT_COUNT;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   83   if (!idx)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   84   plt++;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   85   }
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   87   pltsec->plt_count++;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   88   BUG_ON(pltsec->plt_count * 
PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   90   if (!idx)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   91   /* Populate a new set 
of entries */
7d485f647c1f4a Ard Biesheuvel 2014-11-24   92   *plt = (struct 
plt_entries){
7d485f647c1f4a Ard Biesheuvel 2014-11-24   93   { [0 ... 
PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a Ard Biesheuvel 2014-11-24   94   { val, }
7d485f647c1f4a Ard Biesheuvel 2014-11-24   95   };
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   96   else
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   97   plt->lit[idx] = val;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   99   return (u32)&plt->ldr[idx];
7d485f647c1f4a Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a Ard Biesheuvel 2014-11-24  101  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
___
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe sen

[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2021-11-17 Thread kernel test robot
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   ee1703cda8dc777e937dec172da55beaf1a74919
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   5 months ago
:: branch date: 3 hours ago
:: commit date: 5 months ago
config: arm-randconfig-m031-20211104 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c1 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct module 
*mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   53   struct mod_plt_sec *pltsec = 
!in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   54   
  &mod->arch.init;
79f32b221b18c1 Alex Sverdlin  2021-05-05   55   struct plt_entries *plt;
79f32b221b18c1 Alex Sverdlin  2021-05-05   56   int idx;
79f32b221b18c1 Alex Sverdlin  2021-05-05   57  
79f32b221b18c1 Alex Sverdlin  2021-05-05   58   /* cache the address, ELF 
header is available only during module load */
79f32b221b18c1 Alex Sverdlin  2021-05-05   59   if (!pltsec->plt_ent)
79f32b221b18c1 Alex Sverdlin  2021-05-05   60   pltsec->plt_ent = 
(struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c1 Alex Sverdlin  2021-05-05   61   plt = pltsec->plt_ent;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   62  
79f32b221b18c1 Alex Sverdlin  2021-05-05   63   prealloc_fixed(pltsec, plt);
79f32b221b18c1 Alex Sverdlin  2021-05-05   64  
79f32b221b18c1 Alex Sverdlin  2021-05-05  @65   for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c1 Alex Sverdlin  2021-05-05   66   if (plt->lit[idx] == 
val)
79f32b221b18c1 Alex Sverdlin  2021-05-05   67   return 
(u32)&plt->ldr[idx];
35fa91eed817d2 Ard Biesheuvel 2016-08-16   68  
79f32b221b18c1 Alex Sverdlin  2021-05-05   69   idx = 0;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   70   /*
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   71* Look for an existing entry 
pointing to 'val'. Given that the
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   72* relocations are sorted, this 
will be the last entry we allocated.
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   73* (if one exists).
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   74*/
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   75   if (pltsec->plt_count > 0) {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   76   plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   77   idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   79   if (plt->lit[idx] == 
val)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   80   return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   82   idx = (idx + 1) % 
PLT_ENT_COUNT;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   83   if (!idx)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   84   plt++;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   85   }
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   87   pltsec->plt_count++;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   88   BUG_ON(pltsec->plt_count * 
PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   90   if (!idx)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   91   /* Populate a new set 
of entries */
7d485f647c1f4a Ard Biesheuvel 2014-11-24   92   *plt = (struct 
plt_entries){
7d485f647c1f4a Ard Biesheuvel 2014-11-24   93   { [0 ... 
PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a Ard Biesheuvel 2014-11-24   94   { val, }
7d485f647c1f4a Ard Biesheuvel 2014-11-24   95   };
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   96   else
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   97   plt->lit[idx] = val;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   99   return (u32)&plt->ldr[idx];
7d485f647c1f4a Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a Ard Biesheuvel 2014-11-24  101  

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


.config.gz
Description: application/gzip
___
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@list

[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2021-11-15 Thread kernel test robot
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   8ab774587903771821b59471cc723bba6d893942
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   5 months ago
:: branch date: 25 hours ago
:: commit date: 5 months ago
config: arm-randconfig-m031-20211104 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c15 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct 
module *mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   53  struct mod_plt_sec 
*pltsec = !in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   54  
  &mod->arch.init;
79f32b221b18c15 Alex Sverdlin  2021-05-05   55  struct plt_entries *plt;
79f32b221b18c15 Alex Sverdlin  2021-05-05   56  int idx;
79f32b221b18c15 Alex Sverdlin  2021-05-05   57  
79f32b221b18c15 Alex Sverdlin  2021-05-05   58  /* cache the address, 
ELF header is available only during module load */
79f32b221b18c15 Alex Sverdlin  2021-05-05   59  if (!pltsec->plt_ent)
79f32b221b18c15 Alex Sverdlin  2021-05-05   60  pltsec->plt_ent 
= (struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c15 Alex Sverdlin  2021-05-05   61  plt = pltsec->plt_ent;
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   62  
79f32b221b18c15 Alex Sverdlin  2021-05-05   63  prealloc_fixed(pltsec, 
plt);
79f32b221b18c15 Alex Sverdlin  2021-05-05   64  
79f32b221b18c15 Alex Sverdlin  2021-05-05  @65  for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c15 Alex Sverdlin  2021-05-05   66  if 
(plt->lit[idx] == val)
79f32b221b18c15 Alex Sverdlin  2021-05-05   67  return 
(u32)&plt->ldr[idx];
35fa91eed817d2c Ard Biesheuvel 2016-08-16   68  
79f32b221b18c15 Alex Sverdlin  2021-05-05   69  idx = 0;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   70  /*
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   71   * Look for an existing 
entry pointing to 'val'. Given that the
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   72   * relocations are 
sorted, this will be the last entry we allocated.
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   73   * (if one exists).
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   74   */
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   75  if (pltsec->plt_count > 
0) {
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   76  plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   77  idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   79  if 
(plt->lit[idx] == val)
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   80  return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   82  idx = (idx + 1) 
% PLT_ENT_COUNT;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   83  if (!idx)
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   84  plt++;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   85  }
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   87  pltsec->plt_count++;
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   88  
BUG_ON(pltsec->plt_count * PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   90  if (!idx)
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   91  /* Populate a 
new set of entries */
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   92  *plt = (struct 
plt_entries){
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   93  { [0 
... PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   94  { val, }
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   95  };
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   96  else
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   97  plt->lit[idx] = 
val;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   99  return 
(u32)&plt->ldr[idx];
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a6 Ard Bie

[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2021-11-08 Thread kernel test robot
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   6b75d88fa81b122cce37ebf17428a849ccd3d0f1
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   5 months ago
:: branch date: 24 hours ago
:: commit date: 5 months ago
config: arm-randconfig-m031-20211015 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c1 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct module 
*mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   53   struct mod_plt_sec *pltsec = 
!in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   54   
  &mod->arch.init;
79f32b221b18c1 Alex Sverdlin  2021-05-05   55   struct plt_entries *plt;
79f32b221b18c1 Alex Sverdlin  2021-05-05   56   int idx;
79f32b221b18c1 Alex Sverdlin  2021-05-05   57  
79f32b221b18c1 Alex Sverdlin  2021-05-05   58   /* cache the address, ELF 
header is available only during module load */
79f32b221b18c1 Alex Sverdlin  2021-05-05   59   if (!pltsec->plt_ent)
79f32b221b18c1 Alex Sverdlin  2021-05-05   60   pltsec->plt_ent = 
(struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c1 Alex Sverdlin  2021-05-05   61   plt = pltsec->plt_ent;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   62  
79f32b221b18c1 Alex Sverdlin  2021-05-05   63   prealloc_fixed(pltsec, plt);
79f32b221b18c1 Alex Sverdlin  2021-05-05   64  
79f32b221b18c1 Alex Sverdlin  2021-05-05  @65   for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c1 Alex Sverdlin  2021-05-05   66   if (plt->lit[idx] == 
val)
79f32b221b18c1 Alex Sverdlin  2021-05-05   67   return 
(u32)&plt->ldr[idx];
35fa91eed817d2 Ard Biesheuvel 2016-08-16   68  
79f32b221b18c1 Alex Sverdlin  2021-05-05   69   idx = 0;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   70   /*
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   71* Look for an existing entry 
pointing to 'val'. Given that the
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   72* relocations are sorted, this 
will be the last entry we allocated.
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   73* (if one exists).
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   74*/
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   75   if (pltsec->plt_count > 0) {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   76   plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   77   idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   79   if (plt->lit[idx] == 
val)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   80   return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   82   idx = (idx + 1) % 
PLT_ENT_COUNT;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   83   if (!idx)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   84   plt++;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   85   }
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   87   pltsec->plt_count++;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   88   BUG_ON(pltsec->plt_count * 
PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   90   if (!idx)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   91   /* Populate a new set 
of entries */
7d485f647c1f4a Ard Biesheuvel 2014-11-24   92   *plt = (struct 
plt_entries){
7d485f647c1f4a Ard Biesheuvel 2014-11-24   93   { [0 ... 
PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a Ard Biesheuvel 2014-11-24   94   { val, }
7d485f647c1f4a Ard Biesheuvel 2014-11-24   95   };
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   96   else
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   97   plt->lit[idx] = val;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   99   return (u32)&plt->ldr[idx];
7d485f647c1f4a Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a Ard Biesheuvel 2014-11-24  101  

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


.config.gz
Description: application/gzip
___
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lis

[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2021-11-08 Thread kernel test robot
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   6b75d88fa81b122cce37ebf17428a849ccd3d0f1
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   5 months ago
:: branch date: 13 hours ago
:: commit date: 5 months ago
config: arm-randconfig-m031-20211104 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c1 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct module 
*mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   53   struct mod_plt_sec *pltsec = 
!in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   54   
  &mod->arch.init;
79f32b221b18c1 Alex Sverdlin  2021-05-05   55   struct plt_entries *plt;
79f32b221b18c1 Alex Sverdlin  2021-05-05   56   int idx;
79f32b221b18c1 Alex Sverdlin  2021-05-05   57  
79f32b221b18c1 Alex Sverdlin  2021-05-05   58   /* cache the address, ELF 
header is available only during module load */
79f32b221b18c1 Alex Sverdlin  2021-05-05   59   if (!pltsec->plt_ent)
79f32b221b18c1 Alex Sverdlin  2021-05-05   60   pltsec->plt_ent = 
(struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c1 Alex Sverdlin  2021-05-05   61   plt = pltsec->plt_ent;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   62  
79f32b221b18c1 Alex Sverdlin  2021-05-05   63   prealloc_fixed(pltsec, plt);
79f32b221b18c1 Alex Sverdlin  2021-05-05   64  
79f32b221b18c1 Alex Sverdlin  2021-05-05  @65   for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c1 Alex Sverdlin  2021-05-05   66   if (plt->lit[idx] == 
val)
79f32b221b18c1 Alex Sverdlin  2021-05-05   67   return 
(u32)&plt->ldr[idx];
35fa91eed817d2 Ard Biesheuvel 2016-08-16   68  
79f32b221b18c1 Alex Sverdlin  2021-05-05   69   idx = 0;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   70   /*
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   71* Look for an existing entry 
pointing to 'val'. Given that the
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   72* relocations are sorted, this 
will be the last entry we allocated.
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   73* (if one exists).
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   74*/
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   75   if (pltsec->plt_count > 0) {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   76   plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   77   idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   79   if (plt->lit[idx] == 
val)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   80   return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   82   idx = (idx + 1) % 
PLT_ENT_COUNT;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   83   if (!idx)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   84   plt++;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   85   }
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   87   pltsec->plt_count++;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   88   BUG_ON(pltsec->plt_count * 
PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   90   if (!idx)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   91   /* Populate a new set 
of entries */
7d485f647c1f4a Ard Biesheuvel 2014-11-24   92   *plt = (struct 
plt_entries){
7d485f647c1f4a Ard Biesheuvel 2014-11-24   93   { [0 ... 
PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a Ard Biesheuvel 2014-11-24   94   { val, }
7d485f647c1f4a Ard Biesheuvel 2014-11-24   95   };
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   96   else
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   97   plt->lit[idx] = val;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   99   return (u32)&plt->ldr[idx];
7d485f647c1f4a Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a Ard Biesheuvel 2014-11-24  101  

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


.config.gz
Description: application/gzip
___
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lis

[kbuild] arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

2021-08-19 Thread kernel test robot
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Alex Sverdlin 
CC: "Russell King (Oracle)" 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   d6d09a6942050f21b065a134169002b4d6b701ef
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   2 months ago
:: branch date: 22 hours ago
:: commit date: 2 months ago
config: arm-randconfig-m031-20210818 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c1 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct module 
*mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   53   struct mod_plt_sec *pltsec = 
!in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   54   
  &mod->arch.init;
79f32b221b18c1 Alex Sverdlin  2021-05-05   55   struct plt_entries *plt;
79f32b221b18c1 Alex Sverdlin  2021-05-05   56   int idx;
79f32b221b18c1 Alex Sverdlin  2021-05-05   57  
79f32b221b18c1 Alex Sverdlin  2021-05-05   58   /* cache the address, ELF 
header is available only during module load */
79f32b221b18c1 Alex Sverdlin  2021-05-05   59   if (!pltsec->plt_ent)
79f32b221b18c1 Alex Sverdlin  2021-05-05   60   pltsec->plt_ent = 
(struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c1 Alex Sverdlin  2021-05-05   61   plt = pltsec->plt_ent;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   62  
79f32b221b18c1 Alex Sverdlin  2021-05-05   63   prealloc_fixed(pltsec, plt);
79f32b221b18c1 Alex Sverdlin  2021-05-05   64  
79f32b221b18c1 Alex Sverdlin  2021-05-05  @65   for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c1 Alex Sverdlin  2021-05-05   66   if (plt->lit[idx] == 
val)
79f32b221b18c1 Alex Sverdlin  2021-05-05   67   return 
(u32)&plt->ldr[idx];
35fa91eed817d2 Ard Biesheuvel 2016-08-16   68  
79f32b221b18c1 Alex Sverdlin  2021-05-05   69   idx = 0;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   70   /*
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   71* Look for an existing entry 
pointing to 'val'. Given that the
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   72* relocations are sorted, this 
will be the last entry we allocated.
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   73* (if one exists).
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   74*/
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   75   if (pltsec->plt_count > 0) {
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   76   plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   77   idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   79   if (plt->lit[idx] == 
val)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   80   return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   82   idx = (idx + 1) % 
PLT_ENT_COUNT;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   83   if (!idx)
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   84   plt++;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   85   }
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   87   pltsec->plt_count++;
b7ede5a1f5905a Ard Biesheuvel 2017-02-22   88   BUG_ON(pltsec->plt_count * 
PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   90   if (!idx)
7d485f647c1f4a Ard Biesheuvel 2014-11-24   91   /* Populate a new set 
of entries */
7d485f647c1f4a Ard Biesheuvel 2014-11-24   92   *plt = (struct 
plt_entries){
7d485f647c1f4a Ard Biesheuvel 2014-11-24   93   { [0 ... 
PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a Ard Biesheuvel 2014-11-24   94   { val, }
7d485f647c1f4a Ard Biesheuvel 2014-11-24   95   };
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   96   else
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   97   plt->lit[idx] = val;
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5f Ard Biesheuvel 2016-08-18   99   return (u32)&plt->ldr[idx];
7d485f647c1f4a Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a Ard Biesheuvel 2014-11-24  101  

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


.config.gz
Description: application/gzip
___
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lis