From patchwork Wed Feb 21 23:13:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10234337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 60B5260385 for ; Wed, 21 Feb 2018 23:13:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5343828567 for ; Wed, 21 Feb 2018 23:13:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4776D285B7; Wed, 21 Feb 2018 23:13:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B91CA28567 for ; Wed, 21 Feb 2018 23:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751265AbeBUXNs (ORCPT ); Wed, 21 Feb 2018 18:13:48 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:39149 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbeBUXNs (ORCPT ); Wed, 21 Feb 2018 18:13:48 -0500 Received: by mail-qk0-f196.google.com with SMTP id z197so4240214qkb.6 for ; Wed, 21 Feb 2018 15:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=QwOTgLwcH1sSAEwcX1FaG0xNFze2ZAToN0Ay77QVUwA=; b=GTysJsqCQERZ81meJbg4/ZQSTYSxxj0WCa+XX0Xfnvzbf+P0YHlKrUTbsCug5doTQz uDZuBHZ75g69bDUY/8OeipHE+0RScmRQZpgyawgNOGWhGb3m8LTqvogitzeiVq8FyH6y dW0uf0IBaCGojsVhOol/Nfauqvk72UKBNpag3UYnd8bInIgl4lSabVaw3ErHZp8X1FKB ykPbx4AjF8jqaX81SwbcQB5Jj8QZuLcxiY6E3RDB25TL3M38p9sBnubiO0qAPir4mhha /Q6S58LzoKMbPBcC0XuWXnGHs2HQvYkkRIfnXDEsw4K/cH6KNZn3iqBe56WterEYkxeQ j/Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QwOTgLwcH1sSAEwcX1FaG0xNFze2ZAToN0Ay77QVUwA=; b=I0tnrD9aUPlLiv7QjVBXbme+rKttYvQXFzGU7XdBj0lWbaqbjzLVj+EgELisU49I6J j2TBLtTdMCklvHwEkRunX0NC4xKREBu5o0GMFWO4fzQZEIb/Fz7YuEazRbQN//RfcOBu 4PM8MaDYDYo+HV33SJ1XyN9UKiJovjZbIfcx6Jg1Xr9vigQRmsopd8hivyN4q9jXfqGW Ym6+0Yv+Y1BNeJ026sBhBFKNa2H7VFUkSVyh1qtnK35OMbeMtAR2VWWjb5/OLYtLKx4R otf3hhcFK8C/++1J4yJyjkiC9ZJgYu1e+Sr7MK0iHJOt2HzgbwO1yjAmzVrwR0Hsmlyn F3JQ== X-Gm-Message-State: APf1xPATsrJ97rJmyvXiozlU/hkmWflPeuPtvRQ6kvMKW0CvNCDHiiN5 XjbNy01J6vOVx4JFkjo3igE= X-Google-Smtp-Source: AG47ELvDvLaJuahNq9SQlx11miFc1Lmpt/PgsZfGeWSf/AWo7q61Fo4Yd9Kelqgv+sFs4mqgzqytwg== X-Received: by 10.55.98.149 with SMTP id w143mr7727278qkb.338.1519254827203; Wed, 21 Feb 2018 15:13:47 -0800 (PST) Received: from localhost.localdomain ([2804:14c:482:a5e:d81f:f7db:5766:3221]) by smtp.gmail.com with ESMTPSA id h29sm13022436qtk.94.2018.02.21.15.13.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Feb 2018 15:13:46 -0800 (PST) From: Fabio Estevam To: p.zabel@pengutronix.de Cc: slongerbeam@gmail.com, ian.arkver.dev@gmail.com, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH v3 1/2] media: imx-media-internal-sd: Use empty initializer Date: Wed, 21 Feb 2018 20:13:50 -0300 Message-Id: <1519254831-14452-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam {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 Acked-by: Steve Longerbeam --- 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 --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;