CC: [email protected]
CC: [email protected]
BCC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Tony Lindgren <[email protected]>
TO: Daniel Lezcano <[email protected]>
TO: Thomas Gleixner <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Keerthy <[email protected]>
CC: Vignesh Raghavendra <[email protected]>

Hi Tony,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/timers/core]
[also build test WARNING on tmlind-omap/for-next linus/master v5.18-rc3 
next-20220420]
[cannot apply to daniel-lezcano/clockevents/next]
[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/intel-lab-lkp/linux/commits/Tony-Lindgren/TI-timer-changes-for-am6/20220408-181823
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
3123109284176b1532874591f7c81f3837bbdc17
:::::: branch date: 13 days ago
:::::: commit date: 13 days ago
config: arm-randconfig-c002-20220420 
(https://download.01.org/0day-ci/archive/20220421/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
bac6cd5bf85669e3376610cfc4c4f9ca015e7b9b)
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
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # 
https://github.com/intel-lab-lkp/linux/commit/a90353915d5d39c3181f8002304e951ffa3d2f6b
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review 
Tony-Lindgren/TI-timer-changes-for-am6/20220408-181823
        git checkout a90353915d5d39c3181f8002304e951ffa3d2f6b
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 
clang-analyzer 

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


clang-analyzer warnings: (new ones prefixed by >>)
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   48 warnings generated.
   drivers/hwmon/max1619.c:145:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%d\n", temp_from_reg(data->temp[attr->index]));
                  ^~~~~~~
   drivers/hwmon/max1619.c:145:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%d\n", temp_from_reg(data->temp[attr->index]));
                  ^~~~~~~
   drivers/hwmon/max1619.c:172:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%d\n", data->alarms);
                  ^~~~~~~
   drivers/hwmon/max1619.c:172:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%d\n", data->alarms);
                  ^~~~~~~
   drivers/hwmon/max1619.c:180:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%d\n", (data->alarms >> bitnr) & 1);
                  ^~~~~~~
   drivers/hwmon/max1619.c:180:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%d\n", (data->alarms >> bitnr) & 1);
                  ^~~~~~~
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   50 warnings generated.
   drivers/hwmon/max1668.c:139:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%d\n", data->temp[index] * 1000);
                  ^~~~~~~
   drivers/hwmon/max1668.c:139:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%d\n", data->temp[index] * 1000);
                  ^~~~~~~
   drivers/hwmon/max1668.c:151:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%d\n", data->temp_max[index] * 1000);
                  ^~~~~~~
   drivers/hwmon/max1668.c:151:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%d\n", data->temp_max[index] * 1000);
                  ^~~~~~~
   drivers/hwmon/max1668.c:163:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%d\n", data->temp_min[index] * 1000);
                  ^~~~~~~
   drivers/hwmon/max1668.c:163:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%d\n", data->temp_min[index] * 1000);
                  ^~~~~~~
   drivers/hwmon/max1668.c:175:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%u\n", (data->alarms >> index) & 0x1);
                  ^~~~~~~
   drivers/hwmon/max1668.c:175:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%u\n", (data->alarms >> index) & 0x1);
                  ^~~~~~~
   drivers/hwmon/max1668.c:187:9: warning: Call to function 'sprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           return sprintf(buf, "%u\n",
                  ^~~~~~~
   drivers/hwmon/max1668.c:187:9: note: Call to function 'sprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11
           return sprintf(buf, "%u\n",
                  ^~~~~~~
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   46 warnings generated.
   drivers/i2c/busses/i2c-nomadik.c:1034:2: warning: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           snprintf(adap->name, sizeof(adap->name),
           ^~~~~~~~
   drivers/i2c/busses/i2c-nomadik.c:1034:2: note: Call to function 'snprintf' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11
           snprintf(adap->name, sizeof(adap->name),
           ^~~~~~~~
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   46 warnings generated.
   drivers/i2c/busses/i2c-owl.c:489:2: warning: Call to function 'snprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'snprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           snprintf(i2c_dev->adap.name, sizeof(i2c_dev->adap.name),
           ^~~~~~~~
   drivers/i2c/busses/i2c-owl.c:489:2: note: Call to function 'snprintf' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'snprintf_s' in case of C11
           snprintf(i2c_dev->adap.name, sizeof(i2c_dev->adap.name),
           ^~~~~~~~
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   46 warnings generated.
   drivers/i2c/busses/i2c-pca-platform.c:161:2: warning: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           snprintf(i2c->adap.name, sizeof(i2c->adap.name),
           ^~~~~~~~
   drivers/i2c/busses/i2c-pca-platform.c:161:2: note: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11
           snprintf(i2c->adap.name, sizeof(i2c->adap.name),
           ^~~~~~~~
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   25 warnings generated.
   Suppressed 25 warnings (25 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   26 warnings generated.
>> drivers/clocksource/timer-ti-dm.c:135:18: warning: Division by zero 
>> [clang-analyzer-core.DivideZero]
                   udelay(3500000 / rate + 1);
                                  ^
   drivers/clocksource/timer-ti-dm.c:640:2: note: 'rate' initialized to 0
           unsigned long rate = 0;
           ^~~~~~~~~~~~~~~~~~
   drivers/clocksource/timer-ti-dm.c:642:15: note: Assuming 'timer' is non-null
           if (unlikely(!timer))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   drivers/clocksource/timer-ti-dm.c:642:2: note: Taking false branch
           if (unlikely(!timer))
           ^
   drivers/clocksource/timer-ti-dm.c:645:6: note: Assuming the condition is 
false
           if (!(timer->capability & OMAP_TIMER_NEEDS_RESET))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clocksource/timer-ti-dm.c:645:2: note: Taking false branch
           if (!(timer->capability & OMAP_TIMER_NEEDS_RESET))
           ^
   drivers/clocksource/timer-ti-dm.c:648:45: note: Passing the value 0 via 3rd 
parameter 'rate'
           __omap_dm_timer_stop(timer, timer->posted, rate);
                                                      ^~~~
   drivers/clocksource/timer-ti-dm.c:648:2: note: Calling '__omap_dm_timer_stop'
           __omap_dm_timer_stop(timer, timer->posted, rate);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clocksource/timer-ti-dm.c:125:6: note: Assuming the condition is true
           if (l & OMAP_TIMER_CTRL_ST) {
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/clocksource/timer-ti-dm.c:125:2: note: Taking true branch
           if (l & OMAP_TIMER_CTRL_ST) {
           ^
   drivers/clocksource/timer-ti-dm.c:135:18: note: Division by zero
                   udelay(3500000 / rate + 1);
                                  ^
   arch/arm/include/asm/delay.h:83:24: note: expanded from macro 'udelay'
           (__builtin_constant_p(n) ?                                      \
                                 ^
   Suppressed 25 warnings (25 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   27 warnings generated.
   drivers/clocksource/timer-ti-dm-systimer.c:475:3: warning: Value stored to 
'l' is never read [clang-analyzer-deadcode.DeadStores]
                   l = readl_relaxed(ctrl);
                   ^
   drivers/clocksource/timer-ti-dm-systimer.c:475:3: note: Value stored to 'l' 
is never read
   Suppressed 26 warnings (26 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   25 warnings generated.
   Suppressed 25 warnings (25 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   25 warnings generated.
   Suppressed 25 warnings (25 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   25 warnings generated.
   Suppressed 25 warnings (25 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   26 warnings generated.
   Suppressed 26 warnings (26 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   48 warnings generated.
   drivers/media/i2c/ov772x.c:583:21: warning: Value stored to 'client' during 
its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct i2c_client *client = v4l2_get_subdevdata(sd);
                              ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov772x.c:583:21: note: Value stored to 'client' during its 
initialization is never read
           struct i2c_client *client = v4l2_get_subdevdata(sd);
                              ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 47 warnings (46 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   47 warnings generated.
   Suppressed 47 warnings (46 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   50 warnings generated.
   drivers/media/i2c/ov8856.c:1827:2: warning: Value stored to 'ret' is never 
read [clang-analyzer-deadcode.DeadStores]
           ret = ov8856_write_reg(ov8856, OV8856_REG_FLIP_OPT_1,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov8856.c:1827:2: note: Value stored to 'ret' is never read
           ret = ov8856_write_reg(ov8856, OV8856_REG_FLIP_OPT_1,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov8856.c:1839:2: warning: Value stored to 'ret' is never 
read [clang-analyzer-deadcode.DeadStores]
           ret = ov8856_write_reg(ov8856, OV8856_REG_FLIP_OPT_2,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov8856.c:1839:2: note: Value stored to 'ret' is never read
           ret = ov8856_write_reg(ov8856, OV8856_REG_FLIP_OPT_2,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov8856.c:1849:2: warning: Value stored to 'ret' is never 
read [clang-analyzer-deadcode.DeadStores]
           ret = ov8856_write_reg(ov8856, OV8856_REG_FLIP_OPT_3,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov8856.c:1849:2: note: Value stored to 'ret' is never read
           ret = ov8856_write_reg(ov8856, OV8856_REG_FLIP_OPT_3,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 47 warnings (46 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   47 warnings generated.
   Suppressed 47 warnings (46 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   47 warnings generated.
   Suppressed 47 warnings (46 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   47 warnings generated.
   Suppressed 47 warnings (46 in non-user code, 1 with check filters).

vim +135 drivers/clocksource/timer-ti-dm.c

a90353915d5d39c Tony Lindgren 2022-04-08  118  
a90353915d5d39c Tony Lindgren 2022-04-08  119  static inline void 
__omap_dm_timer_stop(struct omap_dm_timer *timer,
a90353915d5d39c Tony Lindgren 2022-04-08  120                                   
int posted, unsigned long rate)
a90353915d5d39c Tony Lindgren 2022-04-08  121  {
a90353915d5d39c Tony Lindgren 2022-04-08  122   u32 l;
a90353915d5d39c Tony Lindgren 2022-04-08  123  
a90353915d5d39c Tony Lindgren 2022-04-08  124   l = __omap_dm_timer_read(timer, 
OMAP_TIMER_CTRL_REG, posted);
a90353915d5d39c Tony Lindgren 2022-04-08  125   if (l & OMAP_TIMER_CTRL_ST) {
a90353915d5d39c Tony Lindgren 2022-04-08  126           l &= ~0x1;
a90353915d5d39c Tony Lindgren 2022-04-08  127           
__omap_dm_timer_write(timer, OMAP_TIMER_CTRL_REG, l, posted);
a90353915d5d39c Tony Lindgren 2022-04-08  128  #ifdef CONFIG_ARCH_OMAP2PLUS
a90353915d5d39c Tony Lindgren 2022-04-08  129           /* Readback to make 
sure write has completed */
a90353915d5d39c Tony Lindgren 2022-04-08  130           
__omap_dm_timer_read(timer, OMAP_TIMER_CTRL_REG, posted);
a90353915d5d39c Tony Lindgren 2022-04-08  131           /*
a90353915d5d39c Tony Lindgren 2022-04-08  132            * Wait for functional 
clock period x 3.5 to make sure that
a90353915d5d39c Tony Lindgren 2022-04-08  133            * timer is stopped
a90353915d5d39c Tony Lindgren 2022-04-08  134            */
a90353915d5d39c Tony Lindgren 2022-04-08 @135           udelay(3500000 / rate + 
1);
a90353915d5d39c Tony Lindgren 2022-04-08  136  #endif
a90353915d5d39c Tony Lindgren 2022-04-08  137   }
a90353915d5d39c Tony Lindgren 2022-04-08  138  
a90353915d5d39c Tony Lindgren 2022-04-08  139   /* Ack possibly pending 
interrupt */
a90353915d5d39c Tony Lindgren 2022-04-08  140   
writel_relaxed(OMAP_TIMER_INT_OVERFLOW, timer->irq_stat);
a90353915d5d39c Tony Lindgren 2022-04-08  141  }
a90353915d5d39c Tony Lindgren 2022-04-08  142  

-- 
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