From patchwork Tue Apr 28 18:10:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11515351 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7735A112C for ; Tue, 28 Apr 2020 18:10:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FF2D208E0 for ; Tue, 28 Apr 2020 18:10:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VTzEsiCM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jdkX6l3U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FF2D208E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vhdVnjntHYvpzf8CZngnUH9Gkabtn9bmiblmlh5JnMU=; b=VTzEsiCMSw3l2S wobiz9fwYCpnyaGkPQGmo6pmb81r/giVBbA1bBQC7XywUU23bcWOlFW4I+WO84P0xPcDxzdgoDcGb BwuTmYCRG3PVc6peUxP9HKO9gZ34/fcDlY7PVBbZAib2Wkpvw5/DgHGDdZor3WG2Ft51DtJWGDjRS WuJkgT4rBA77RGMlfkZnpU+osue6EcPLwWIemygvDiD3uU/KvGBhB/9Ix7xqFx+xNfJNxAwLyp9Wa G5IS2Nhkf1vqoMxMTwp8d3uIiSIEfCvImXyo5xTzKDMwuJbob7aXXhttFbDD5nf6gwZOLF/T3yOgC PRrCmwP7r4nwv7j6yqvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUgg-0005q9-Ky; Tue, 28 Apr 2020 18:10:30 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUgP-0005cJ-J9 for linux-arm-kernel@lists.infradead.org; Tue, 28 Apr 2020 18:10:15 +0000 Received: by mail-pf1-x444.google.com with SMTP id d184so11093648pfd.4 for ; Tue, 28 Apr 2020 11:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pzR0VAatcGCv2TaFAPhug2WYMJZ8JLRsVVUKQdZJepo=; b=jdkX6l3UqUCLDCTewHorQRjMf21oxTo6rOvLVMIJNk2uIdHTHZzvqWa5kgmcPOrxUi NWQEMSjo6yk0IWsdl+dHB1UVJNpsjboN+5JgTrsmDUL1lhFMxR4mEfucfx3Ejm52yNJq 4AVDhISobCn3yLHKS0nzOIqhewaE+HztbgNOw= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=pzR0VAatcGCv2TaFAPhug2WYMJZ8JLRsVVUKQdZJepo=; b=GDY2/4IIsc/K+f0GwSDE0jCQbCeOfNa48YhAHvPDQWO6mz/gOA9owZvI8SnvXyaPW2 8Bqk0JCqtq0CEdlvMEnO99POuMFf+N1GJtpNhYwKBEpi4EjQsln7VE+kbSMZgQckRr0H OddP4utirkMo9J0Z2Dvv6cL5DtrhMy/gK/sqR95HA/7JtkH661tlf4Oo4lmNP7dHW3Dh QR98uUFv48+awi3wRYVYc3gZRlwSJg3mpbkkVjbr1DiSVJVThGw7tSaY/tToQrT4LH3D k2FGbktyu2SG28Nc4cG+WGCZQVOwvyBND8KOLsqWbvrnlA+8h2SunIlb5RTE8W/nAs3d bPOA== X-Gm-Message-State: AGi0PuZtdgUsxUNTl97hNLAc/8Gtvkap4lYyIiBPwQ3HUxigtz0Q7gvu PtnzfYb4jwr0VMQyC1U8+TBI4Q== X-Google-Smtp-Source: APiQypIbQFQdy+iWWUMbbuNFGA5jRE5oHCH/IGvzlWQeCyuF1u6U87LYpWBmIbmboyJidQzTnibkxQ== X-Received: by 2002:aa7:9ac9:: with SMTP id x9mr12944651pfp.304.1588097412814; Tue, 28 Apr 2020 11:10:12 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h197sm16260910pfe.208.2020.04.28.11.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 11:10:12 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH v2 1/2] coresight: Include required headers in C files Date: Tue, 28 Apr 2020 11:10:09 -0700 Message-Id: <20200428181010.170568-2-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200428181010.170568-1-swboyd@chromium.org> References: <20200428181010.170568-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200428_111013_651914_BE2C19AD X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Suzuki K Poulose , Mike Leach , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Douglas Anderson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We should include headers that C files use in the C files that use them and avoid relying on implicit includes as much as possible. This helps avoid compiler errors in the future about missing declarations when header files change includes in the future. Cc: Douglas Anderson Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd --- .../hwtracing/coresight/coresight-cti-platform.c | 8 +++++++- drivers/hwtracing/coresight/coresight-cti-sysfs.c | 7 +++++++ drivers/hwtracing/coresight/coresight-cti.c | 13 +++++++++++++ drivers/hwtracing/coresight/coresight-cti.h | 8 +++++++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c index c6c0c9b4827e..ab3bd4ed0910 100644 --- a/drivers/hwtracing/coresight/coresight-cti-platform.c +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c @@ -2,11 +2,17 @@ /* * Copyright (c) 2019, The Linaro Limited. All rights reserved. */ +#include +#include +#include +#include +#include +#include #include -#include #include "coresight-cti.h" +#include "coresight-priv.h" /* Number of CTI signals in the v8 architecturally defined connection */ #define NR_V8PE_IN_SIGS 2 diff --git a/drivers/hwtracing/coresight/coresight-cti-sysfs.c b/drivers/hwtracing/coresight/coresight-cti-sysfs.c index aeea39cbd161..77e14e770806 100644 --- a/drivers/hwtracing/coresight/coresight-cti-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-cti-sysfs.c @@ -4,7 +4,14 @@ * Author: Mike Leach */ +#include #include +#include +#include +#include +#include +#include +#include #include "coresight-cti.h" diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers/hwtracing/coresight/coresight-cti.c index 7fc1fc8d7738..be61c1705916 100644 --- a/drivers/hwtracing/coresight/coresight-cti.c +++ b/drivers/hwtracing/coresight/coresight-cti.c @@ -4,7 +4,20 @@ * Author: Mike Leach */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + +#include "coresight-priv.h" #include "coresight-cti.h" /** diff --git a/drivers/hwtracing/coresight/coresight-cti.h b/drivers/hwtracing/coresight/coresight-cti.h index 004df3ab9dd0..acf7b545e6b9 100644 --- a/drivers/hwtracing/coresight/coresight-cti.h +++ b/drivers/hwtracing/coresight/coresight-cti.h @@ -7,8 +7,14 @@ #ifndef _CORESIGHT_CORESIGHT_CTI_H #define _CORESIGHT_CORESIGHT_CTI_H -#include +#include +#include +#include +#include #include +#include +#include + #include "coresight-priv.h" /* From patchwork Tue Apr 28 18:10:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11515353 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A830392C for ; Tue, 28 Apr 2020 18:11:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87D1E206A1 for ; Tue, 28 Apr 2020 18:11:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OJ/N3jVa"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="odBlKV08" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87D1E206A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rV9frYMB7mMs1igHxl60HwXVGemYhm7Akf2MVZYUWV8=; b=OJ/N3jVaLI3zTf aNOdvWVoAZyBnTSv7frpo2PAZgGG6pCzPkaaoIhIlRQ7IcqjnnBvVBXYcOpggoc8jv8mgnHvgo1Tt vJMBHNgMkcSEXn1KXfDEYEcWw06+e3FhBqunZ54NKmitCBKgU5uMetoKX+s8ogKNqLKH12tunS2nY 2coXLWWxonhiUMsypnbHo/zXeoJ/yTrscCUdDt+90s7LZs1LnXXxXrNXiqLeZK9k5bf3ztnhFHNDe HpVe9reCrBqT+MkHSU2vqAqIZ3RUW1XBfyIyEG4t5QFygSrIVQgquufrMmzX2Z2UPDsP+rF4OT845 9eFM5HFPKGsnM4dGkoWQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUh9-00066C-Gp; Tue, 28 Apr 2020 18:10:59 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUgQ-0005cp-GK for linux-arm-kernel@lists.infradead.org; Tue, 28 Apr 2020 18:10:16 +0000 Received: by mail-pg1-x543.google.com with SMTP id r4so10762461pgg.4 for ; Tue, 28 Apr 2020 11:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=feeBoZmiNK+PqfmUZIUHdcZ4oBKPOjHptWecqjvhfI4=; b=odBlKV081b57bKb3sexaYhZ/qqcstSbg/s2iZYJthN7dEiR/vQ+YpQrlo3lkUvQWy3 MjiNjirFDo5mutK+0rE9HWjSjOD4HkEqLHDaGUt7AE2b3OBugG1Ww3EkGpdGis00LY6Q gjCU62klhAJN2mXBhEgl2s/FwKD1XU8iv0xLc= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=feeBoZmiNK+PqfmUZIUHdcZ4oBKPOjHptWecqjvhfI4=; b=daSQdj3UiUTWkZ9K9j3aHbNFv+rDRqZj1JoA33JH/k3+KEm2yEAV9B0Mb+aBR67AaY LXYS3LHqehuLEukJcq1o9KRPkQ3rU0E0HEccrBDShFoZ+ncvryPaMC9ViCI55pMrZW0/ URd+ctYM2cddnMfHh7ik1/vEM+atDycSWlzXePKonK8a1wIlQiXBB7Ngx8rFKEN5hmJi 5TPFJ5k55wH/xUxHmMo9OHzXJah9M+jOIGPzQ3OEAd6Je/fPY2H7pGvSx1w2Z+voSng5 HEBtt23rs54G6ZrMXZWDAmbPs67X/CQCc11xibUGIckSyWp6eQK8mix2s3gWIDVOFIpW cKag== X-Gm-Message-State: AGi0Pub5vOlsIURBiKdYdK3Q1I4ddEGmOir1W/1AsyQKU6DT3RQjLzxL VbbxTHEw5uqi2CdbP5f4u/2iCw== X-Google-Smtp-Source: APiQypIL/096cicyoZjsKpAn19BhU3sgp026+T4Ap3M/8jcviaZEa8JyagUmCZZBtGmw0suU4VD5Xg== X-Received: by 2002:a63:3814:: with SMTP id f20mr27969431pga.283.1588097413701; Tue, 28 Apr 2020 11:10:13 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h197sm16260910pfe.208.2020.04.28.11.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 11:10:13 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH v2 2/2] coresight: Avoid casting void pointers Date: Tue, 28 Apr 2020 11:10:10 -0700 Message-Id: <20200428181010.170568-3-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200428181010.170568-1-swboyd@chromium.org> References: <20200428181010.170568-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200428_111014_544084_4DD22CE1 X-CRM114-Status: GOOD ( 12.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Mike Leach , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Suzuki K Poulose Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We don't need to cast void pointers, such as the amba_id data. Assign to a local variable to make the code prettier and also return NULL instead of 0 to make sparse happy. Cc: Suzuki K Poulose Cc: Mike Leach Reviewed-by: Joe Perches Signed-off-by: Stephen Boyd --- Thanks Joe for finding my thinko! drivers/hwtracing/coresight/coresight-priv.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index 5a36f0f50899..36c943ae94d5 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -215,9 +215,12 @@ cti_remove_assoc_from_csdev(struct coresight_device *csdev) {} /* extract the data value from a UCI structure given amba_id pointer. */ static inline void *coresight_get_uci_data(const struct amba_id *id) { - if (id->data) - return ((struct amba_cs_uci_id *)(id->data))->data; - return 0; + struct amba_cs_uci_id *uci_id = id->data; + + if (!uci_id) + return NULL; + + return uci_id->data; } void coresight_release_platform_data(struct coresight_device *csdev,