:::::: 
:::::: Manual check reason: "low confidence static check warning: 
drivers/base/regmap/regmap.c:1966:19: warning: Redundant condition: !map->bus. 
'map->bus || (!map->bus && map->read)' is equivalent to 'map->bus || map->read' 
[redundantCondition]"
:::::: 

CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Marek Vasut <[email protected]>
CC: Mark Brown <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   30306f6194cadcc29c77f6ddcd416a75bf5c0232
commit: d77e745613680c54708470402e2b623dcd769681 regmap: Add bulk read/write 
callbacks into regmap_config
date:   6 weeks ago
:::::: branch date: 13 hours ago
:::::: commit date: 6 weeks ago
compiler: hppa-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout d77e745613680c54708470402e2b623dcd769681
        cppcheck --quiet --enable=style,performance,portability --template=gcc 
FILE

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>


cppcheck warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/drm_modes.c:1833:16: warning: Local variable 'len' shadows 
>> outer variable [shadowVariable]
     unsigned int len = strlen(mode_option);
                  ^
   drivers/gpu/drm/drm_modes.c:1769:9: note: Shadowed declaration
    int i, len, ret;
           ^
   drivers/gpu/drm/drm_modes.c:1833:16: note: Shadow variable
     unsigned int len = strlen(mode_option);
                  ^

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/gpu/drm/drm_of.c:30:28: warning: Parameter 'port' can be declared 
>> with const [constParameter]
          struct device_node *port)
                              ^
--
>> drivers/gpu/drm/drm_gem_framebuffer_helper.c:67:28: warning: Parameter 'obj' 
>> can be declared with const [constParameter]
      struct drm_gem_object **obj, unsigned int num_planes,
                              ^
--
>> drivers/base/regmap/regmap.c:1966:19: warning: Redundant condition: 
>> !map->bus. 'map->bus || (!map->bus && map->read)' is equivalent to 'map->bus 
>> || map->read' [redundantCondition]
    return (map->bus || (!map->bus && map->read)) ? map : map->bus_context;
                     ^
   drivers/base/regmap/regmap.c:1838:7: warning: Redundant initialization for 
'ret'. The initialized value is overwritten before it is read. 
[redundantInitialization]
     ret = map->write(map->bus_context, map->work_buf,
         ^
   drivers/base/regmap/regmap.c:1685:10: note: ret is initialized
    int ret = -ENOTSUPP;
            ^
   drivers/base/regmap/regmap.c:1838:7: note: ret is overwritten
     ret = map->write(map->bus_context, map->work_buf,
         ^

vim +1966 drivers/base/regmap/regmap.c

07c320dc31d757 Andrey Smirnov 2013-01-12  1963  
d2a5884a64161b Andrey Smirnov 2013-01-27  1964  static inline void 
*_regmap_map_get_context(struct regmap *map)
d2a5884a64161b Andrey Smirnov 2013-01-27  1965  {
d77e745613680c Marek Vasut    2022-04-30 @1966          return (map->bus || 
(!map->bus && map->read)) ? map : map->bus_context;
d2a5884a64161b Andrey Smirnov 2013-01-27  1967  }
d2a5884a64161b Andrey Smirnov 2013-01-27  1968  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to