From patchwork Fri May 25 16:08:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 136965 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3780416lji; Fri, 25 May 2018 09:08:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqylrT3T+k5yjPxNfPXe9sa+8pdwxEml5i50edTBP/NRYEB723CVqeGn0oFw60bmnnGl8xC X-Received: by 2002:a17:902:b786:: with SMTP id e6-v6mr3309868pls.260.1527264527250; Fri, 25 May 2018 09:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527264527; cv=none; d=google.com; s=arc-20160816; b=RJICFu6tB2RPRhjZG/BMSkDFcBRNl9cRTUIE5BHFprduyvM+NPt6/Dy8EgOnnLnxFY GdGI0MG1J2r7iIa9baRVK4ILLqtuep8fOms/lOkOyPk6up8lU/MrJKBwXzsHUG1+YQKD kUGFiJcb2wpZ/3lwEaPYzjV3BCn0Tw13nGVwrUWp+MlFr0cdkMbM5FVa2gfC6gUbAusG ikx32iDGhiLfl4VPQ8HpziM5SgTduvrOJzL7K5lLH8/OTqBeESDm7KRjmi5bYYWRhpFx Uv3/4ZjsJ93FXmTjuOYrl4yZdIAmyu4Y8z5Bk4dfX8Bo22h6kSzwXuPcCE49L9StDTOR l6aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8wTDwjtCvXmEMWB7j+cSMzauiL8ZiyeslB71GFRu+J4=; b=nv2SsfyeuDu4wrZRqJN4O2Z7wHtAhy7+LivYdtt4yMsoSARBOTUCL7iO/YQ2XuH5c1 OnC0Dk1kKYDyXL4MngLcppT4oWidGJj/2DlT82C0lhIACrL8uMTQdZRVucaxvl/+GJ1s qNTrpzsu7pgBDg9/7wT/hGgX8tFaMrCG6BcgJXLykwzIHKNPM1X4lC66/Xt9KkcSz24n q+x8VtyoecOtGY3s5Dado85C9d9EB8DFkvjNE233O5rrUKJV+sDKBkJYhBGQEsS8E1XL 00PjRBMosZAy7yUgKsWXuCl8yjFWuEVdJGy+YDnbiFtH3MBdeHmXEuPr4QCVy5FPIVFl qRlg== 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 u16-v6si7767767pgv.600.2018.05.25.09.08.46; Fri, 25 May 2018 09:08:47 -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 S967252AbeEYQIo (ORCPT + 30 others); Fri, 25 May 2018 12:08:44 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:57587 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966719AbeEYQIm (ORCPT ); Fri, 25 May 2018 12:08:42 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MLgKR-1fN4Tu18ex-000vGy; Fri, 25 May 2018 18:08:37 +0200 From: Arnd Bergmann To: Andy Gross , David Brown Cc: Arnd Bergmann , Bjorn Andersson , Srinivas Kandagatla , Evan Green , Karthikeyan Ramasubramanian , Mahesh Sivasubramanian , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] qcom: cmd-db: enforce CONFIG_OF_RESERVED_MEM dependency Date: Fri, 25 May 2018 18:08:24 +0200 Message-Id: <20180525160836.125531-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:sPRHk80euo/+cajDazVMNbQyWWrZC/+Jf8GUaSacJfOEGr2OwxX aOKH5Og0D8j8YxFlBql8HGzW1jReZ6IPMQOXLnMRTaZPdcuqFTJDDWLWuhnrt9pfKZvyLRY E89sXpNidmMqRU21Ko//hrcKQN/366WI+osMOTn2oN1nn8fwPxJDMRmqevzJ5K3WOS0nsaX /a2G9AUkPMyzlOV5gPksg== X-UI-Out-Filterresults: notjunk:1; V01:K0:bhIAYpb2B3w=:Rrv85xzNhfUE957bQzYPzQ WWUFx1NszY7uR0kE1KBPRfyw4S0noKh+9J6NQwq3fqYBhWABvJpPIw2mg4JmLztfGbiwNv3Fn 1G5ddB8sMOwPgeZOxltX6/kjg9j8u6HQg4nUBq5sstvd1s+8Ei1XjdVOenPRdQRJonAd59PkI rYWO81f6Pi0Iv8TVl54HRCwWMcf5xDwJYve8Fa39qRzV+ZfY6ww7Y9h0EoI6nZwISeWI6Inb1 Ek+VA8iQw/1TZeTSC3OTMsq8/EW/LmDJ7HGbzk+li+X0Rs0pDuqpNO8PfjdoTB2EwEd3JDE9B FlJ7DbyOW6JP5rHcJSlHeR1VT2dDeG6M0hfXxJ6Wy7lcv+YikUkKy67StFvu5a2NBfV7iejQT OJnEdnZ4ifq7xVItbq9GJWeI0MhTRVgsO0nTU+0xCvQqTpU9bMSJr/ZGHPwhgcNdnEegkHeL6 iCaiVxTK1eWtSuSEQ5EFSl/jPA0mShpCXAU1SOba212djO1aDpAVetPC4EZmiyVJS/w6Boigh wAif+kDx06BY2MIDQ0RmGp1aKV5q74okq/L53u9FO2RcjiVLySZH9Vd5+PQ/eCnGOhbpQsxKO TiccSDoHMwChKZiaUNV/0ZZJByvbS4T++GKptuxS22lOUE5ZCKYvnQF1NG/9Xy0J9yxEHYHlC jKXQqwMHJIKNuOJWeG2aDwiy3bVREb+c3WA5su3e+WPHSma4TeH1re3cUEZhe/MhccPs= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Without CONFIG_OF_RESERVED_MEM, gcc sees that the global cmd_db_header variable is never initialized, and through code optimization concludes that a lot of other code cannot possibly work after that: drivers/soc/qcom/cmd-db.c: In function 'cmd_db_read_addr': drivers/soc/qcom/cmd-db.c:197:21: error: 'ent.addr' may be used uninitialized in this function [-Werror=maybe-uninitialized] return ret < 0 ? 0 : le32_to_cpu(ent.addr); drivers/soc/qcom/cmd-db.c: In function 'cmd_db_read_aux_data': drivers/soc/qcom/cmd-db.c:224:10: error: 'ent.len' may be used uninitialized in this function [-Werror=maybe-uninitialized] ent_len = le16_to_cpu(ent.len); drivers/soc/qcom/cmd-db.c:115:6: error: 'rsc_hdr.data_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] u16 offset = le16_to_cpu(hdr->data_offset); ^~~~~~ drivers/soc/qcom/cmd-db.c:116:6: error: 'ent.offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] u16 loffset = le16_to_cpu(ent->offset); ^~~~~~~ drivers/soc/qcom/cmd-db.c: In function 'cmd_db_read_aux_data_len': drivers/soc/qcom/cmd-db.c:250:38: error: 'ent.len' may be used uninitialized in this function [-Werror=maybe-uninitialized] return ret < 0 ? 0 : le16_to_cpu(ent.len); ^ drivers/soc/qcom/cmd-db.c: In function 'cmd_db_read_slave_id': drivers/soc/qcom/cmd-db.c:272:7: error: 'ent.addr' may be used uninitialized in this function [-Werror=maybe-uninitialized] Using a hard CONFIG_OF_RESERVED_MEM dependency avoids this warning, and we can remove the CONFIG_OF dependency. Signed-off-by: Arnd Bergmann --- drivers/soc/qcom/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 9dc02f390ba3..5856e792d09c 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -5,7 +5,8 @@ menu "Qualcomm SoC drivers" config QCOM_COMMAND_DB bool "Qualcomm Command DB" - depends on (ARCH_QCOM && OF) || COMPILE_TEST + depends on ARCH_QCOM || COMPILE_TEST + depends on OF_RESERVED_MEM help Command DB queries shared memory by key string for shared system resources. Platform drivers that require to set state of a shared