From: Javier Martinez Canillas <javier.martinez@collabora.co.uk> To: Mark Brown <broonie@kernel.org> Cc: Kukjin Kim <kgene.kim@samsung.com>, Chanwoo Choi <cw00.choi@samsung.com>, Olof Johansson <olof@lixom.net>, Chris Zhong <zyw@rock-chips.com>, Krzysztof Kozlowski <k.kozlowski@samsung.com>, Abhilash Kesavan <kesavan.abhilash@gmail.com>, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Javier Martinez Canillas <javier.martinez@collabora.co.uk> Subject: [PATCH v4 05/14] regulator: max1586: zero-initialize regulator match table array Date: Mon, 3 Nov 2014 15:40:40 +0100 [thread overview] Message-ID: <1415025649-8119-6-git-send-email-javier.martinez@collabora.co.uk> (raw) In-Reply-To: <1415025649-8119-1-git-send-email-javier.martinez@collabora.co.uk> The struct of_regulator_match rmatch[] is declared as a non-static local variable so the structure members are not auto-initialized. Initialize the array at declaration time to avoid the structure members values to be indeterminate and have sane defaults instead. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> --- drivers/regulator/max1586.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 86db310..d2a8c64 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -163,7 +163,7 @@ static int of_get_max1586_platform_data(struct device *dev, struct max1586_platform_data *pdata) { struct max1586_subdev_data *sub; - struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)]; + struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)] = { }; struct device_node *np = dev->of_node; int i, matched; -- 2.1.0
WARNING: multiple messages have this Message-ID (diff)
From: Javier Martinez Canillas <javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Cc: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>, Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>, Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>, Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>, Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>, Abhilash Kesavan <kesavan.abhilash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Javier Martinez Canillas <javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> Subject: [PATCH v4 05/14] regulator: max1586: zero-initialize regulator match table array Date: Mon, 3 Nov 2014 15:40:40 +0100 [thread overview] Message-ID: <1415025649-8119-6-git-send-email-javier.martinez@collabora.co.uk> (raw) In-Reply-To: <1415025649-8119-1-git-send-email-javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> The struct of_regulator_match rmatch[] is declared as a non-static local variable so the structure members are not auto-initialized. Initialize the array at declaration time to avoid the structure members values to be indeterminate and have sane defaults instead. Signed-off-by: Javier Martinez Canillas <javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> --- drivers/regulator/max1586.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 86db310..d2a8c64 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -163,7 +163,7 @@ static int of_get_max1586_platform_data(struct device *dev, struct max1586_platform_data *pdata) { struct max1586_subdev_data *sub; - struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)]; + struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)] = { }; struct device_node *np = dev->of_node; int i, matched; -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-03 14:42 UTC|newest] Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-11-03 14:40 [PATCH v4 00/14] Add max77802 regulator operating mode support Javier Martinez Canillas 2014-11-03 14:40 ` [PATCH v4 01/14] regulator: Document binding for initial and suspend modes Javier Martinez Canillas 2014-11-03 14:40 ` [PATCH v4 02/14] regulator: Add function to map modes to struct regulator_desc Javier Martinez Canillas 2014-11-04 10:31 ` Krzysztof Kozlowski 2014-11-04 11:02 ` Javier Martinez Canillas 2014-11-04 11:09 ` Krzysztof Kozlowski 2014-11-03 14:40 ` [PATCH v4 03/14] regulator: of: Add regulator desc param to of_get_regulator_init_data() Javier Martinez Canillas 2014-11-03 15:33 ` Mark Brown 2014-11-03 15:48 ` Javier Martinez Canillas 2014-11-03 15:59 ` Mark Brown 2014-11-03 16:11 ` Javier Martinez Canillas 2014-11-03 14:40 ` [PATCH v4 04/14] regulator: of: Pass the regulator description in the match table Javier Martinez Canillas 2014-11-03 14:40 ` Javier Martinez Canillas [this message] 2014-11-03 14:40 ` [PATCH v4 05/14] regulator: max1586: zero-initialize regulator match table array Javier Martinez Canillas 2014-11-03 15:41 ` Mark Brown 2014-11-03 15:51 ` Javier Martinez Canillas 2014-11-03 14:40 ` [PATCH v4 06/14] regulator: max77686: zero-initialize regulator match table Javier Martinez Canillas 2014-11-03 15:55 ` Mark Brown 2014-11-03 14:40 ` [PATCH v4 07/14] regulator: max77802: " Javier Martinez Canillas 2014-11-03 15:55 ` Mark Brown 2014-11-03 14:40 ` [PATCH v4 08/14] regulator: max8660: zero-initialize regulator match table array Javier Martinez Canillas 2014-11-03 14:40 ` Javier Martinez Canillas 2014-11-03 15:56 ` Mark Brown 2014-11-03 14:40 ` [PATCH v4 09/14] regulator: s2mpa01: " Javier Martinez Canillas 2014-11-03 15:56 ` Mark Brown 2014-11-03 14:40 ` [PATCH v4 10/14] regulator: of: Add support for parsing initial and suspend modes Javier Martinez Canillas 2014-11-04 10:41 ` Krzysztof Kozlowski 2014-11-04 10:41 ` Krzysztof Kozlowski 2014-11-04 11:07 ` Javier Martinez Canillas 2014-11-03 14:40 ` [PATCH v4 11/14] regulator: max77802: Document binding for regulator operating modes Javier Martinez Canillas 2014-11-04 10:50 ` Krzysztof Kozlowski 2014-11-04 11:10 ` Javier Martinez Canillas 2014-11-03 14:40 ` [PATCH v4 12/14] regulator: max77802: Use unsigned int for modes in max77802_map_mode() Javier Martinez Canillas 2014-11-03 16:08 ` Mark Brown 2014-11-03 14:40 ` [PATCH v4 13/14] regulator: max77802: Set regulator modes translation callback Javier Martinez Canillas 2014-11-03 14:40 ` [PATCH v4 14/14] ARM: dts: Configure regulators for suspend on exynos Peach boards Javier Martinez Canillas 2014-11-03 15:54 ` [PATCH v4 00/14] Add max77802 regulator operating mode support Mark Brown 2014-11-03 16:07 ` Mark Brown 2014-11-03 16:08 ` Javier Martinez Canillas 2014-11-04 10:44 ` Krzysztof Kozlowski 2014-11-04 10:44 ` Krzysztof Kozlowski 2014-11-04 10:51 ` Javier Martinez Canillas 2014-11-04 11:04 ` Krzysztof Kozlowski
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=1415025649-8119-6-git-send-email-javier.martinez@collabora.co.uk \ --to=javier.martinez@collabora.co.uk \ --cc=broonie@kernel.org \ --cc=cw00.choi@samsung.com \ --cc=devicetree@vger.kernel.org \ --cc=k.kozlowski@samsung.com \ --cc=kesavan.abhilash@gmail.com \ --cc=kgene.kim@samsung.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=olof@lixom.net \ --cc=zyw@rock-chips.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: linkBe 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.