diff mbox

[v3,1/2] media: imx-media-internal-sd: Use empty initializer

Message ID 1519254831-14452-1-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam Feb. 21, 2018, 11:13 p.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

{0} explicitly assigns 0 to the first member of the structure.

The first element of the platform_device_info struct is a pointer and
when writing 0 to a pointer the following sparse error is seen:

drivers/staging/media/imx/imx-media-internal-sd.c:274:49: warning: Using plain integer as NULL pointer

Fix this problem by using an empty initializer, which also clears the
struct members and avoids the sparse warning.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
Changes sice v2:
- Improve commit log

Changes since v1:
- Use empty initializer insted of memset() - Ian

 drivers/staging/media/imx/imx-media-internal-sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/staging/media/imx/imx-media-internal-sd.c b/drivers/staging/media/imx/imx-media-internal-sd.c
index 70833fe..daf66c2 100644
--- a/drivers/staging/media/imx/imx-media-internal-sd.c
+++ b/drivers/staging/media/imx/imx-media-internal-sd.c
@@ -271,7 +271,7 @@  static int add_internal_subdev(struct imx_media_dev *imxmd,
 			       int ipu_id)
 {
 	struct imx_media_internal_sd_platformdata pdata;
-	struct platform_device_info pdevinfo = {0};
+	struct platform_device_info pdevinfo = {};
 	struct platform_device *pdev;
 
 	pdata.grp_id = isd->id->grp_id;