From: David Laight <david.laight.linux@gmail.com>
To: Manish Baing <manishbaing2789@gmail.com>
Cc: jk@codeconstruct.com.au, matt@codeconstruct.com.au,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mctp: serial: replace memset with zero-initialization
Date: Sun, 31 May 2026 10:12:37 +0100 [thread overview]
Message-ID: <20260531101237.13c5580d@pumpkin> (raw)
In-Reply-To: <20260530224646.160777-1-manishbaing2789@gmail.com>
On Sat, 30 May 2026 22:46:46 +0000
Manish Baing <manishbaing2789@gmail.com> wrote:
> Use empty brace initialization (= {}) instead of explicit memset()
> to zero-initialize stack memory to simplify the code.
>
> No functional change.
Isn't it also entirely pointless?
-- David
>
> Signed-off-by: Manish Baing <manishbaing2789@gmail.com>
> ---
> Changes in v2:
> - Fixed a compilation error caused by a duplicate variable declaration caught
> by the kernel test robot.
>
> drivers/net/mctp/mctp-serial.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/mctp/mctp-serial.c b/drivers/net/mctp/mctp-serial.c
> index 26c9a33fd636..df721ca4e07b 100644
> --- a/drivers/net/mctp/mctp-serial.c
> +++ b/drivers/net/mctp/mctp-serial.c
> @@ -536,13 +536,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;
>
next prev parent reply other threads:[~2026-05-31 9:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-30 22:46 [PATCH v2] mctp: serial: replace memset with zero-initialization Manish Baing
2026-05-31 9:12 ` David Laight [this message]
2026-05-31 9:36 ` Manish Baing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260531101237.13c5580d@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manishbaing2789@gmail.com \
--cc=matt@codeconstruct.com.au \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox