* [PATCH] clocksource/drivers: remove unnecessary return in switch statement
@ 2022-04-25 8:46 ` cgel.zte
0 siblings, 0 replies; 5+ messages in thread
From: cgel.zte @ 2022-04-25 8:46 UTC (permalink / raw)
To: daniel
Cc: romain.perier, daniel.lezcano, tglx, linux-arm-kernel,
linux-kernel, Minghao Chi, Zeal Robot
From: Minghao Chi <chi.minghao@zte.com.cn>
Since there's a return immediately after the 'break', there's no need for
this extra 'return'.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
drivers/clocksource/timer-msc313e.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/clocksource/timer-msc313e.c b/drivers/clocksource/timer-msc313e.c
index 54c54ca7c786..fedcbcafd320 100644
--- a/drivers/clocksource/timer-msc313e.c
+++ b/drivers/clocksource/timer-msc313e.c
@@ -233,14 +233,10 @@ static int __init msc313e_timer_init(struct device_node *np)
switch (num_called) {
case 0:
ret = msc313e_clksrc_init(np);
- if (ret)
- return ret;
break;
default:
ret = msc313e_clkevt_init(np);
- if (ret)
- return ret;
break;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] clocksource/drivers: remove unnecessary return in switch statement
@ 2022-04-25 8:46 ` cgel.zte
0 siblings, 0 replies; 5+ messages in thread
From: cgel.zte @ 2022-04-25 8:46 UTC (permalink / raw)
To: daniel
Cc: romain.perier, daniel.lezcano, tglx, linux-arm-kernel,
linux-kernel, Minghao Chi, Zeal Robot
From: Minghao Chi <chi.minghao@zte.com.cn>
Since there's a return immediately after the 'break', there's no need for
this extra 'return'.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
drivers/clocksource/timer-msc313e.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/clocksource/timer-msc313e.c b/drivers/clocksource/timer-msc313e.c
index 54c54ca7c786..fedcbcafd320 100644
--- a/drivers/clocksource/timer-msc313e.c
+++ b/drivers/clocksource/timer-msc313e.c
@@ -233,14 +233,10 @@ static int __init msc313e_timer_init(struct device_node *np)
switch (num_called) {
case 0:
ret = msc313e_clksrc_init(np);
- if (ret)
- return ret;
break;
default:
ret = msc313e_clkevt_init(np);
- if (ret)
- return ret;
break;
}
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] clocksource/drivers: remove unnecessary return in switch statement
2022-04-25 8:46 ` cgel.zte
@ 2022-04-25 18:05 ` kernel test robot
-1 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-04-25 18:05 UTC (permalink / raw)
To: cgel.zte, daniel
Cc: kbuild-all, romain.perier, daniel.lezcano, tglx,
linux-arm-kernel, linux-kernel, Minghao Chi, Zeal Robot
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/timers/core]
[also build test WARNING on v5.18-rc4 next-20220422]
[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/cgel-zte-gmail-com/clocksource-drivers-remove-unnecessary-return-in-switch-statement/20220425-170540
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git ce8abf340e40e1126bfcb9e7679b3d6b524ae3e0
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220426/202204260158.ccGqDClt-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.3.0
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
# https://github.com/intel-lab-lkp/linux/commit/f185e49aea517bee5dfb706df47fa5f70bfac370
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review cgel-zte-gmail-com/clocksource-drivers-remove-unnecessary-return-in-switch-statement/20220425-170540
git checkout f185e49aea517bee5dfb706df47fa5f70bfac370
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/clocksource/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/clocksource/timer-msc313e.c: In function 'msc313e_timer_init':
>> drivers/clocksource/timer-msc313e.c:230:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
230 | int ret = 0;
| ^~~
vim +/ret +230 drivers/clocksource/timer-msc313e.c
5fc1f93f69989e Romain Perier 2021-12-17 227
5fc1f93f69989e Romain Perier 2021-12-17 228 static int __init msc313e_timer_init(struct device_node *np)
5fc1f93f69989e Romain Perier 2021-12-17 229 {
5fc1f93f69989e Romain Perier 2021-12-17 @230 int ret = 0;
5fc1f93f69989e Romain Perier 2021-12-17 231 static int num_called;
5fc1f93f69989e Romain Perier 2021-12-17 232
5fc1f93f69989e Romain Perier 2021-12-17 233 switch (num_called) {
5fc1f93f69989e Romain Perier 2021-12-17 234 case 0:
5fc1f93f69989e Romain Perier 2021-12-17 235 ret = msc313e_clksrc_init(np);
5fc1f93f69989e Romain Perier 2021-12-17 236 break;
5fc1f93f69989e Romain Perier 2021-12-17 237
5fc1f93f69989e Romain Perier 2021-12-17 238 default:
5fc1f93f69989e Romain Perier 2021-12-17 239 ret = msc313e_clkevt_init(np);
5fc1f93f69989e Romain Perier 2021-12-17 240 break;
5fc1f93f69989e Romain Perier 2021-12-17 241 }
5fc1f93f69989e Romain Perier 2021-12-17 242
5fc1f93f69989e Romain Perier 2021-12-17 243 num_called++;
5fc1f93f69989e Romain Perier 2021-12-17 244
5fc1f93f69989e Romain Perier 2021-12-17 245 return 0;
5fc1f93f69989e Romain Perier 2021-12-17 246 }
5fc1f93f69989e Romain Perier 2021-12-17 247
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clocksource/drivers: remove unnecessary return in switch statement
@ 2022-04-25 18:05 ` kernel test robot
0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-04-25 18:05 UTC (permalink / raw)
To: cgel.zte, daniel
Cc: kbuild-all, romain.perier, daniel.lezcano, tglx,
linux-arm-kernel, linux-kernel, Minghao Chi, Zeal Robot
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/timers/core]
[also build test WARNING on v5.18-rc4 next-20220422]
[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/cgel-zte-gmail-com/clocksource-drivers-remove-unnecessary-return-in-switch-statement/20220425-170540
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git ce8abf340e40e1126bfcb9e7679b3d6b524ae3e0
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220426/202204260158.ccGqDClt-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.3.0
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
# https://github.com/intel-lab-lkp/linux/commit/f185e49aea517bee5dfb706df47fa5f70bfac370
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review cgel-zte-gmail-com/clocksource-drivers-remove-unnecessary-return-in-switch-statement/20220425-170540
git checkout f185e49aea517bee5dfb706df47fa5f70bfac370
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/clocksource/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/clocksource/timer-msc313e.c: In function 'msc313e_timer_init':
>> drivers/clocksource/timer-msc313e.c:230:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
230 | int ret = 0;
| ^~~
vim +/ret +230 drivers/clocksource/timer-msc313e.c
5fc1f93f69989e Romain Perier 2021-12-17 227
5fc1f93f69989e Romain Perier 2021-12-17 228 static int __init msc313e_timer_init(struct device_node *np)
5fc1f93f69989e Romain Perier 2021-12-17 229 {
5fc1f93f69989e Romain Perier 2021-12-17 @230 int ret = 0;
5fc1f93f69989e Romain Perier 2021-12-17 231 static int num_called;
5fc1f93f69989e Romain Perier 2021-12-17 232
5fc1f93f69989e Romain Perier 2021-12-17 233 switch (num_called) {
5fc1f93f69989e Romain Perier 2021-12-17 234 case 0:
5fc1f93f69989e Romain Perier 2021-12-17 235 ret = msc313e_clksrc_init(np);
5fc1f93f69989e Romain Perier 2021-12-17 236 break;
5fc1f93f69989e Romain Perier 2021-12-17 237
5fc1f93f69989e Romain Perier 2021-12-17 238 default:
5fc1f93f69989e Romain Perier 2021-12-17 239 ret = msc313e_clkevt_init(np);
5fc1f93f69989e Romain Perier 2021-12-17 240 break;
5fc1f93f69989e Romain Perier 2021-12-17 241 }
5fc1f93f69989e Romain Perier 2021-12-17 242
5fc1f93f69989e Romain Perier 2021-12-17 243 num_called++;
5fc1f93f69989e Romain Perier 2021-12-17 244
5fc1f93f69989e Romain Perier 2021-12-17 245 return 0;
5fc1f93f69989e Romain Perier 2021-12-17 246 }
5fc1f93f69989e Romain Perier 2021-12-17 247
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clocksource/drivers: remove unnecessary return in switch statement
@ 2022-05-02 0:01 kernel test robot
0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-05-02 0:01 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 19214 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220425084644.3495153-1-chi.minghao@zte.com.cn>
References: <20220425084644.3495153-1-chi.minghao@zte.com.cn>
TO: cgel.zte(a)gmail.com
TO: daniel(a)thingy.jp
CC: romain.perier(a)gmail.com
CC: daniel.lezcano(a)linaro.org
CC: tglx(a)linutronix.de
CC: linux-arm-kernel(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org
CC: Minghao Chi <chi.minghao@zte.com.cn>
CC: Zeal Robot <zealci@zte.com.cn>
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/timers/core]
[also build test WARNING on v5.18-rc4 next-20220429]
[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/cgel-zte-gmail-com/clocksource-drivers-remove-unnecessary-return-in-switch-statement/20220425-170540
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git ce8abf340e40e1126bfcb9e7679b3d6b524ae3e0
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: riscv-randconfig-c006-20220501 (https://download.01.org/0day-ci/archive/20220502/202205020700.vsW8b2Yn-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 09325d36061e42b495d1f4c7e933e260eac260ed)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/f185e49aea517bee5dfb706df47fa5f70bfac370
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review cgel-zte-gmail-com/clocksource-drivers-remove-unnecessary-return-in-switch-statement/20220425-170540
git checkout f185e49aea517bee5dfb706df47fa5f70bfac370
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
if (!edmac->edma->m2m && dir != ep93xx_dma_chan_direction(chan)) {
^~~~~~~~~~~~~~~~~
drivers/dma/ep93xx_dma.c:1125:24: note: Left side of '&&' is false
if (!edmac->edma->m2m && dir != ep93xx_dma_chan_direction(chan)) {
^
drivers/dma/ep93xx_dma.c:1131:6: note: Assuming the condition is false
if (test_and_set_bit(EP93XX_DMA_IS_CYCLIC, &edmac->flags)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/ep93xx_dma.c:1131:2: note: Taking false branch
if (test_and_set_bit(EP93XX_DMA_IS_CYCLIC, &edmac->flags)) {
^
drivers/dma/ep93xx_dma.c:1137:6: note: Assuming 'period_len' is <= DMA_MAX_CHAN_BYTES
if (period_len > DMA_MAX_CHAN_BYTES) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/ep93xx_dma.c:1137:2: note: Taking false branch
if (period_len > DMA_MAX_CHAN_BYTES) {
^
drivers/dma/ep93xx_dma.c:1146:2: note: Null pointer value stored to 'first'
first = NULL;
^~~~~~~~~~~~
drivers/dma/ep93xx_dma.c:1147:19: note: Assuming 'offset' is >= 'buf_len'
for (offset = 0; offset < buf_len; offset += period_len) {
^~~~~~~~~~~~~~~~
drivers/dma/ep93xx_dma.c:1147:2: note: Loop condition is false. Execution continues on line 1170
for (offset = 0; offset < buf_len; offset += period_len) {
^
drivers/dma/ep93xx_dma.c:1170:20: note: Dereference of null pointer
first->txd.cookie = -EBUSY;
~~~~~~~~~~~~~~~~~~^~~~~~~~
drivers/dma/ep93xx_dma.c:1237:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&edmac->slave_config, config, sizeof(*config));
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
drivers/dma/ep93xx_dma.c:1237:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(&edmac->slave_config, config, sizeof(*config));
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
Suppressed 38 warnings (38 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.
53 warnings generated.
fs/nilfs2/ioctl.c:802:3: warning: Value stored to 'msg' is never read [clang-analyzer-deadcode.DeadStores]
msg = "cannot delete checkpoints";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/nilfs2/ioctl.c:802:3: note: Value stored to 'msg' is never read
msg = "cannot delete checkpoints";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/nilfs2/ioctl.c:811:3: warning: Value stored to 'msg' is never read [clang-analyzer-deadcode.DeadStores]
msg = "cannot delete virtual blocks from DAT file";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/nilfs2/ioctl.c:811:3: note: Value stored to 'msg' is never read
msg = "cannot delete virtual blocks from DAT file";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/nilfs2/ioctl.c:819:3: warning: Value stored to 'msg' is never read [clang-analyzer-deadcode.DeadStores]
msg = "cannot mark copying blocks dirty";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/nilfs2/ioctl.c:819:3: note: Value stored to 'msg' is never read
msg = "cannot mark copying blocks dirty";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 50 warnings (50 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.
Suppressed 50 warnings (50 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.
Suppressed 50 warnings (50 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.
52 warnings generated.
Suppressed 52 warnings (52 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.
Suppressed 50 warnings (50 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.
52 warnings generated.
Suppressed 52 warnings (52 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.
Suppressed 50 warnings (50 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.
52 warnings generated.
Suppressed 52 warnings (52 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.
42 warnings generated.
>> drivers/clocksource/timer-msc313e.c:235:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = msc313e_clksrc_init(np);
^ ~~~~~~~~~~~~~~~~~~~~~~~
drivers/clocksource/timer-msc313e.c:235:3: note: Value stored to 'ret' is never read
ret = msc313e_clksrc_init(np);
^ ~~~~~~~~~~~~~~~~~~~~~~~
drivers/clocksource/timer-msc313e.c:239:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = msc313e_clkevt_init(np);
^ ~~~~~~~~~~~~~~~~~~~~~~~
drivers/clocksource/timer-msc313e.c:239:3: note: Value stored to 'ret' is never read
ret = msc313e_clkevt_init(np);
^ ~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 40 warnings (39 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.
37 warnings generated.
drivers/of/base.c:1296:2: warning: Call to function 'memset' 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 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(it, 0, sizeof(*it));
^
include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
#define memset(p, c, s) __fortify_memset_chk(p, c, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
__underlying_memset(p, c, __fortify_size); \
^~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
#define __underlying_memset __builtin_memset
^~~~~~~~~~~~~~~~
drivers/of/base.c:1296:2: note: Call to function 'memset' 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 'memset_s' in case of C11
memset(it, 0, sizeof(*it));
^
include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
#define memset(p, c, s) __fortify_memset_chk(p, c, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
__underlying_memset(p, c, __fortify_size); \
^~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
#define __underlying_memset __builtin_memset
^~~~~~~~~~~~~~~~
drivers/of/base.c:1886:2: warning: Call to function 'strncpy' 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 'strncpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
strncpy(ap->stem, stem, stem_len);
^~~~~~~
drivers/of/base.c:1886:2: note: Call to function 'strncpy' 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 'strncpy_s' in case of C11
strncpy(ap->stem, stem, stem_len);
^~~~~~~
drivers/of/base.c:1957:3: warning: Call to function 'memset' 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 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(ap, 0, sizeof(*ap) + len + 1);
^
include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
#define memset(p, c, s) __fortify_memset_chk(p, c, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
__underlying_memset(p, c, __fortify_size); \
^~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
#define __underlying_memset __builtin_memset
^~~~~~~~~~~~~~~~
drivers/of/base.c:1957:3: note: Call to function 'memset' 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 'memset_s' in case of C11
memset(ap, 0, sizeof(*ap) + len + 1);
^
include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
#define memset(p, c, s) __fortify_memset_chk(p, c, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
__underlying_memset(p, c, __fortify_size); \
^~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
#define __underlying_memset __builtin_memset
^~~~~~~~~~~~~~~~
Suppressed 34 warnings (34 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.
51 warnings generated.
drivers/regulator/pfuze100-regulator.c:763:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(pfuze_chip->regulator_descs, pfuze_chip->pfuze_regulators,
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
drivers/regulator/pfuze100-regulator.c:763:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(pfuze_chip->regulator_descs, pfuze_chip->pfuze_regulators,
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
Suppressed 50 warnings (50 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.
51 warnings generated.
vim +/ret +235 drivers/clocksource/timer-msc313e.c
5fc1f93f69989e Romain Perier 2021-12-17 227
5fc1f93f69989e Romain Perier 2021-12-17 228 static int __init msc313e_timer_init(struct device_node *np)
5fc1f93f69989e Romain Perier 2021-12-17 229 {
5fc1f93f69989e Romain Perier 2021-12-17 230 int ret = 0;
5fc1f93f69989e Romain Perier 2021-12-17 231 static int num_called;
5fc1f93f69989e Romain Perier 2021-12-17 232
5fc1f93f69989e Romain Perier 2021-12-17 233 switch (num_called) {
5fc1f93f69989e Romain Perier 2021-12-17 234 case 0:
5fc1f93f69989e Romain Perier 2021-12-17 @235 ret = msc313e_clksrc_init(np);
5fc1f93f69989e Romain Perier 2021-12-17 236 break;
5fc1f93f69989e Romain Perier 2021-12-17 237
5fc1f93f69989e Romain Perier 2021-12-17 238 default:
5fc1f93f69989e Romain Perier 2021-12-17 239 ret = msc313e_clkevt_init(np);
5fc1f93f69989e Romain Perier 2021-12-17 240 break;
5fc1f93f69989e Romain Perier 2021-12-17 241 }
5fc1f93f69989e Romain Perier 2021-12-17 242
5fc1f93f69989e Romain Perier 2021-12-17 243 num_called++;
5fc1f93f69989e Romain Perier 2021-12-17 244
5fc1f93f69989e Romain Perier 2021-12-17 245 return 0;
5fc1f93f69989e Romain Perier 2021-12-17 246 }
5fc1f93f69989e Romain Perier 2021-12-17 247
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-02 0:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 8:46 [PATCH] clocksource/drivers: remove unnecessary return in switch statement cgel.zte
2022-04-25 8:46 ` cgel.zte
2022-04-25 18:05 ` kernel test robot
2022-04-25 18:05 ` kernel test robot
2022-05-02 0:01 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.