Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp315046imm; Tue, 18 Sep 2018 22:35:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY+hkvoAQcDMrQDc4LlxBcO6pTZnFa33ssgnoGXS5pHG4diqlnbD5VrBEOG/J0VqucydIt8 X-Received: by 2002:a17:902:8308:: with SMTP id bd8-v6mr32481807plb.134.1537335335176; Tue, 18 Sep 2018 22:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537335335; cv=none; d=google.com; s=arc-20160816; b=wakyLiL6U8bOQel+9TqVlnLDIxaWelY2Oab+ZfWOw1qTID/MVSZa50T3m8BV1hBjRq vdSeMIxjK5aMyofGL1Urze05cCZQbGgQuqXMHzu+e9wBjXdsz0Xz9OWho0y7FcukiHYy KI0JDPrWPg9kKKjxOFsyk5G8bQ19mLsyIAxLdaGKEyZQpjFpoHWFVLlWS7ORpazvjq2f tCPpYk4wmDMz0g24SqEKHuTu+VDMl1GMSNWW+G+x9yogsQVQ7uGhenYiW9cAbDDZQjBg uKEQ70MR+QXOeIGllOhZMATYubFim/folacepYiuzixbxKICvgqKcF9iPKseCt3olo34 Labw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5y1d6BU6E/zUySrGWLTVl6D3qGX2sELAwVGWmnmBPnU=; b=Q91IXPmWZD/7SgmFgSqZGjqvlIuQFedY83mDQRrx0xYXysdRC/pPniiYyWS1F33k+u /W2LU2bL5Hq8nZT7yzQISGMiN88Fvxkz1KNmFa/BqE2t97OCKlKOFYRZr60lLmxI/snL pkr839fjYbf1PaGK1ne1has2FGYXTRQXEspmdPj/toAUc9FTfKjsD4u9aRx49DLyCeCG hpkPiuAfvJvp0Eq/V1uQPr9YMhqsj2IFLwgV6TGzUo01Zv0mNft/CJ24UkWrQTBjHuQK AX51CVoDTrrTw7kutea0Mzmm6LC7Ja7cmhITwTOqmb4lKzFdhNeKVL68difWaZ+IFQ/o Ydwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11-v6si20911275plb.383.2018.09.18.22.35.18; Tue, 18 Sep 2018 22:35:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730756AbeISLL0 (ORCPT + 99 others); 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 1.7.12.4