From patchwork Wed Sep 19 05:22:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: zhong jiang X-Patchwork-Id: 10605271 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 299995A4 for ; Wed, 19 Sep 2018 05:35:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08DC32BA05 for ; Wed, 19 Sep 2018 05:35:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF86B2BAF6; Wed, 19 Sep 2018 05:35:14 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 90BC92BA05 for ; Wed, 19 Sep 2018 05:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbeISLL0 (ORCPT ); Wed, 19 Sep 2018 07:11:26 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:55841 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726972AbeISLL0 (ORCPT ); Wed, 19 Sep 2018 07:11:26 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 18B2A7BB3B802; Wed, 19 Sep 2018 13:35:08 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Wed, 19 Sep 2018 13:35:04 +0800 From: zhong jiang To: , CC: , , Subject: [PATCH] soc: qcom: cmd-db: Fix some uninitialized warning. Date: Wed, 19 Sep 2018 13:22:44 +0800 Message-ID: <1537334564-32266-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the following compile warning: drivers/soc/qcom/cmd-db.c:194:38: warning: ‘ent.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? 0 : le32_to_cpu(ent.addr); drivers/soc/qcom/cmd-db.c:247:38: warning: ‘ent.len’ may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? 0 : le16_to_cpu(ent.len); drivers/soc/qcom/cmd-db.c:269:24: warning: ‘ent.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] addr = le32_to_cpu(ent.addr); Signed-off-by: zhong jiang --- drivers/soc/qcom/cmd-db.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index a6f6462..280877f 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -186,7 +186,7 @@ static int cmd_db_get_header(const char *id, struct entry_header *eh, u32 cmd_db_read_addr(const char *id) { int ret; - struct entry_header ent; + struct entry_header ent = {0}; struct rsc_hdr rsc_hdr; ret = cmd_db_get_header(id, &ent, &rsc_hdr); @@ -239,7 +239,7 @@ int cmd_db_read_aux_data(const char *id, u8 *data, size_t len) size_t cmd_db_read_aux_data_len(const char *id) { int ret; - struct entry_header ent; + struct entry_header ent = {0}; struct rsc_hdr rsc_hdr; ret = cmd_db_get_header(id, &ent, &rsc_hdr); @@ -258,7 +258,7 @@ size_t cmd_db_read_aux_data_len(const char *id) enum cmd_db_hw_type cmd_db_read_slave_id(const char *id) { int ret; - struct entry_header ent; + struct entry_header ent = {0}; struct rsc_hdr rsc_hdr; u32 addr;