All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@mailbox.org>
To: Lukasz Majewski <lukma@denx.de>,
	u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>
Cc: Anatolij Gustschin <agust@denx.de>,
	Ramon Fried <rfried.dev@gmail.com>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Michal Simek <michal.simek@amd.com>
Subject: Re: [PATCH v1 3/6] net: mv88e61xx: Clear temporary structs before using them in get_phy_id()
Date: Thu, 1 Jun 2023 12:36:27 +0200	[thread overview]
Message-ID: <e5fc1652-fc38-6577-a3b4-3ca0b5fc6207@mailbox.org> (raw)
In-Reply-To: <20230601100005.2216345-4-lukma@denx.de>

On 6/1/23 12:00, Lukasz Majewski wrote:
> Those automatically created structures can have random value.
> However, mv88e61xx driver assumes that those are zeroed.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
> ---
> 
>   drivers/net/phy/mv88e61xx.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c
> index 4aee83551beb..c19c3dfa8b6d 100644
> --- a/drivers/net/phy/mv88e61xx.c
> +++ b/drivers/net/phy/mv88e61xx.c
> @@ -1213,6 +1213,10 @@ int get_phy_id(struct mii_dev *bus, int smi_addr, int devad, u32 *phy_id)
>   	struct mii_dev temp_mii;
>   	int val;
>   
> +	memset(&temp_phy, 0, sizeof(temp_phy));
> +	memset(&temp_priv, 0, sizeof(temp_priv));
> +	memset(&temp_mii, 0, sizeof(temp_mii));

struct mii_dev temp_mii = { 0 }; etc

should work all the same, no need for memset.

  reply	other threads:[~2023-06-01 10:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01  9:59 [PATCH v1 0/6] Provide support for mv88e6020 Marvell switch Lukasz Majewski
2023-06-01 10:00 ` [PATCH v1 1/6] net: mv88e61xx: Add support for checking addressing mode Lukasz Majewski
2023-06-01 10:00 ` [PATCH v1 2/6] net: mv88e61xx: Configure PHY ports to also pass packets between them Lukasz Majewski
2023-06-01 10:35   ` Marek Vasut
2023-06-01 11:02     ` Lukasz Majewski
2023-06-01 11:44       ` Marek Vasut
2023-06-01 16:46         ` Vladimir Oltean
2023-06-02 13:56           ` Lukasz Majewski
2023-06-01 10:00 ` [PATCH v1 3/6] net: mv88e61xx: Clear temporary structs before using them in get_phy_id() Lukasz Majewski
2023-06-01 10:36   ` Marek Vasut [this message]
2023-06-01 10:00 ` [PATCH v1 4/6] net: mv88e61xx: Directly access the switch chip Lukasz Majewski
2023-06-01 10:00 ` [PATCH v1 5/6] net: mv88e61xx: Set proper offset when R0_LED/ADDR4 is set on bootstrap Lukasz Majewski
2023-06-01 10:00 ` [PATCH v1 6/6] net: mv88e61xx: Reset switch PHYs when bootstrapped to !NO_CPU Lukasz Majewski
2023-06-01 10:38   ` Marek Vasut
2023-06-01 12:13     ` Lukasz Majewski
2023-06-01 15:16       ` Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2021-03-17 14:14 [PATCH v1 0/6] Provide support for mv88e6020 Marvell switch Lukasz Majewski
2021-03-17 14:14 ` [PATCH v1 3/6] net: mv88e61xx: Clear temporary structs before using them in get_phy_id() Lukasz Majewski
2021-05-08  6:25   ` Ramon Fried

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=e5fc1652-fc38-6577-a3b4-3ca0b5fc6207@mailbox.org \
    --to=marek.vasut@mailbox.org \
    --cc=agust@denx.de \
    --cc=joe.hershberger@ni.com \
    --cc=lukma@denx.de \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=michal.simek@amd.com \
    --cc=rfried.dev@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 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.