* [PATCH] mctp: serial: replace memset with zero-initialization
@ 2026-05-30 17:56 Manish Baing
2026-05-30 21:41 ` kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: Manish Baing @ 2026-05-30 17:56 UTC (permalink / raw)
To: jk, matt
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, manishbaing2789
Use empty brace initialization (= {}) instead of explicit memset()
to zero-initialize stack memory to simplify the code.
No functional change.
Signed-off-by: Manish Baing <manishbaing2789@gmail.com>
---
drivers/net/mctp/mctp-serial.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mctp/mctp-serial.c b/drivers/net/mctp/mctp-serial.c
index 26c9a33fd636..c97ebd1af356 100644
--- a/drivers/net/mctp/mctp-serial.c
+++ b/drivers/net/mctp/mctp-serial.c
@@ -537,12 +537,12 @@ struct test_chunk_tx {
static void test_next_chunk_len(struct kunit *test)
{
struct mctp_serial devx;
+ struct mctp_serial devx = { };
struct mctp_serial *dev = &devx;
int next;
const struct test_chunk_tx *params = test->param_value;
- memset(dev, 0x0, sizeof(*dev));
memcpy(dev->txbuf, params->input, params->input_len);
dev->txlen = params->input_len;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mctp: serial: replace memset with zero-initialization
2026-05-30 17:56 [PATCH] mctp: serial: replace memset with zero-initialization Manish Baing
@ 2026-05-30 21:41 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-30 21:41 UTC (permalink / raw)
To: Manish Baing, jk, matt
Cc: oe-kbuild-all, andrew+netdev, davem, edumazet, kuba, pabeni,
netdev, linux-kernel, manishbaing2789
Hi Manish,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v7.1-rc5 next-20260529]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Manish-Baing/mctp-serial-replace-memset-with-zero-initialization/20260531-015807
base: linus/master
patch link: https://lore.kernel.org/r/20260530175618.135533-1-manishbaing2789%40gmail.com
patch subject: [PATCH] mctp: serial: replace memset with zero-initialization
config: x86_64-buildonly-randconfig-001-20260531 (https://download.01.org/0day-ci/archive/20260531/202605310538.R9GEHEYK-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260531/202605310538.R9GEHEYK-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605310538.R9GEHEYK-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/mctp/mctp-serial.c: In function 'test_next_chunk_len':
>> drivers/net/mctp/mctp-serial.c:540:28: error: redeclaration of 'devx' with no linkage
540 | struct mctp_serial devx = { };
| ^~~~
drivers/net/mctp/mctp-serial.c:539:28: note: previous declaration of 'devx' with type 'struct mctp_serial'
539 | struct mctp_serial devx;
| ^~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for MFD_STMFX
Depends on [n]: HAS_IOMEM [=y] && I2C [=y] && OF [=n]
Selected by [y]:
- PINCTRL_STMFX [=y] && PINCTRL [=y] && I2C [=y] && HAS_IOMEM [=y]
vim +/devx +540 drivers/net/mctp/mctp-serial.c
536
537 static void test_next_chunk_len(struct kunit *test)
538 {
539 struct mctp_serial devx;
> 540 struct mctp_serial devx = { };
541 struct mctp_serial *dev = &devx;
542 int next;
543
544 const struct test_chunk_tx *params = test->param_value;
545
546 memcpy(dev->txbuf, params->input, params->input_len);
547 dev->txlen = params->input_len;
548
549 for (size_t i = 0; i < MAX_CHUNKS; i++) {
550 next = next_chunk_len(dev);
551 dev->txpos += next;
552 KUNIT_EXPECT_EQ(test, next, params->chunks[i]);
553
554 if (next == 0) {
555 KUNIT_EXPECT_EQ(test, dev->txpos, dev->txlen);
556 return;
557 }
558 }
559
560 KUNIT_FAIL_AND_ABORT(test, "Ran out of chunks");
561 }
562
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-30 21:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-30 17:56 [PATCH] mctp: serial: replace memset with zero-initialization Manish Baing
2026-05-30 21:41 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox