From patchwork Sun Apr 26 18:58:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11510925 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 AA199913 for ; Sun, 26 Apr 2020 18:58:28 +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 20270206A2 for ; Sun, 26 Apr 2020 18:58:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XpId5Ydm"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BdVhKtLA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20270206A2 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=+gRnONRkLDbRODo0GSYyI0TEue6V2goCZUgOYa6AXzE=; b=XpId5YdmnpMyiJ KQyDroSxnza5fYfAFbypPnKCci3QtnLTD/rvNyJSk4/M1onbubjIJ42aBgg4OXJHcj8pGkRSHNR6R p0CmfUA65EHU53UdL693ugyekJnBxB8f0AUjyRBRH0h/pUb/uT1Acfh1uI6eDd9DtjgXzdvZash6P W1pW9x+1B6xelI1U5m6szTqLN4Aj44XxYdznjpanGiYi6iKkYsrTgzwlgBzhj6kxkVS306j3kHmOs dRZk9ucL5Fhcsl7411kt2yCjYg+u5Hs4uK6lI9FvA8xcOogf/pc5mRMibe1czIZOH9PmAT4NzmbIk 6qlYY1yBEucWrU2aJkRQ==; 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 1jSmTu-0006Bq-J0; Sun, 26 Apr 2020 18:58:22 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSmTg-0005z9-LZ for linux-arm-kernel@lists.infradead.org; Sun, 26 Apr 2020 18:58:09 +0000 Received: by mail-pj1-x1036.google.com with SMTP id a7so6374224pju.2 for ; Sun, 26 Apr 2020 11:58:08 -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=4Nh28scNPsJXa8VBHQt4qXLeY3lEoVVK2enXEW037c0=; b=BdVhKtLAP0JExFZ1sxuVIzCP4UamXqGzOA3++lUZEsFGktO/3zTuXEeXwpJHFRA6FY 3avnihY1WBEmDoPBBzZ1g4DoNSlELeEHrnEHsEGR8DPCqyyjvzRl13d4R0OJMzKE9a93 13WwOc+ATON9XvG0YCvzqL5Da1nr39Jbr0gNk= 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=4Nh28scNPsJXa8VBHQt4qXLeY3lEoVVK2enXEW037c0=; b=s7IIH3Z7cEnKAjOSMW0PPqH6c2XiUDiZTsDED6egdMmNJbvFaUqkdR6EZrB6PN6XvU O4JrmkrzYyRrMCYzTfVM7WGAdYopy+lg9KsY04wSrIpTOrJsm1+chRwXXA2UYDwk3Nbo OwtX1xrAdJFZLXu+SfQVBc1di685GhWbn71+1D1mzXOxwepCs/nY4lnruqsI5dfvaRu9 4w+gy0wbAf0dwCKHeRNEAyqjBblr1hdMOJHXXrxs3PvA2pIMAjpePSW/qvys6C0iCpcy IpBk4zN3fYakGrFtFdo0rMOuMCxPXrPZlUDDWyqAD94GyEvF0KcomuyQeBhjAtWrzBse vLHg== X-Gm-Message-State: AGi0PuYRMFZAkLyAg40JBMmH8ZZFFkaBMdEfXxDhSs6t1qbU+/sRQCFj NDoXVudPYyxXQYDGwY9m/63oJA== X-Google-Smtp-Source: APiQypJBNQXj9WHyF+IHGBzdHYcC2ttp7i7C/jxQ8C7MxpSFBYk7GD5NVXVTP8g1XaGKZmouC3xE1Q== X-Received: by 2002:a17:90a:6fe4:: with SMTP id e91mr19725593pjk.28.1587927487680; Sun, 26 Apr 2020 11:58:07 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h27sm9425153pgb.90.2020.04.26.11.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 11:58:07 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH 1/5] coresight: Include required headers in C files Date: Sun, 26 Apr 2020 11:58:01 -0700 Message-Id: <20200426185805.14923-2-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200426185805.14923-1-swboyd@chromium.org> References: <20200426185805.14923-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200426_115808_701481_ACC608AA X-CRM114-Status: GOOD ( 10.55 ) 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:1036 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 --- drivers/hwtracing/coresight/coresight-cti-platform.c | 8 +++++++- drivers/hwtracing/coresight/coresight-cti-sysfs.c | 7 +++++++ drivers/hwtracing/coresight/coresight-cti.h | 10 +++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c index b44d83142b62..245f16c61af8 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 1f8fb7c15e80..bed460541f15 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.h b/drivers/hwtracing/coresight/coresight-cti.h index 004df3ab9dd0..d80123b905a8 100644 --- a/drivers/hwtracing/coresight/coresight-cti.h +++ b/drivers/hwtracing/coresight/coresight-cti.h @@ -7,8 +7,10 @@ #ifndef _CORESIGHT_CORESIGHT_CTI_H #define _CORESIGHT_CORESIGHT_CTI_H -#include +#include #include +#include + #include "coresight-priv.h" /* @@ -52,6 +54,12 @@ */ #define CTIINOUTEN_MAX 32 +struct attribute; +struct attribute_group; +struct coresight_device; +struct device; +struct fwnode_handle; + /** * Group of related trigger signals * From patchwork Sun Apr 26 18:58:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11510927 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 1757F913 for ; Sun, 26 Apr 2020 18:58:51 +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 E98CD205C9 for ; Sun, 26 Apr 2020 18:58:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ex8ZD9vX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gcArO+Ib" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E98CD205C9 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=a/dhmffpyNALexWu6Vz0ZsigSA36Dmm+AXybjn1Xb0o=; b=Ex8ZD9vXcjMa99 DOdCxvBC4yLrzI4XT7pq7DHuzhWJzg1Tz9jYKCLw1yV9prdkun8vPLIVnLuMCLI0mxbX6h0AZS435 eaYaQ0USLmOjOYzkrsOmTlKoffCg/I6fjuP1z+Mhv3po4KW0wQ9AORhIJy/eoIhcFk5h5/NQUws/k dsSKwAE+5Lpzb8mkcOgyvMvGY0CEG2k376TUkcvVi313kR6aEKjDikySl2Ik3NT4Pm2FpnZdvjII7 ovrBwYKcYbObALvURC3uyhzArzJk136FvYlty8YCviBnIBJ3gNsD9tBGJMIKN549Y+axWDCCP66Mv KHLryt7+KYFz97/PciVQ==; 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 1jSmUH-0006T3-Hg; Sun, 26 Apr 2020 18:58:45 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSmTh-0005zk-Bz for linux-arm-kernel@lists.infradead.org; Sun, 26 Apr 2020 18:58:10 +0000 Received: by mail-pg1-x541.google.com with SMTP id x26so7528756pgc.10 for ; Sun, 26 Apr 2020 11:58:08 -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=noMrbgL1v2kzIBYfD0+OneUE3HearHlx1xTI8N0UkeU=; b=gcArO+IbQ1Yfcn/7FcXBVLKjbmyJ5VuBH/upO/eC6zjYuLDLsPIwqrgw/uQm4n9D8J hM7YhOGJBsrM5Q6Dkh2na9vKhr6sTp96HDvdrz9okTXc5FbVRReGVGJ0lAlCsAg/qjod Rz+HszoxhcEhePkfbqNlsrUvvYk5OiNwpVa6Y= 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=noMrbgL1v2kzIBYfD0+OneUE3HearHlx1xTI8N0UkeU=; b=onDZRyMnZ1ZnMWLyNri+XwwtrhqDrsO7evHv5U1SaIQ601Vg6CytUV1I8BItgSLcSr AwLAd9i4pQ97ms+dY5ueHkcev6V1ozf/oh0t0VrGyAo+9RKfBocad2ZOnW3WbFzlmJgl Gy9Y4U/l4zQNDBIeNj8lhc5ZdaBHwWOf7sUqzYUrDG0DqMoX0lMB+Ht34p4iMBbH7Qrx CPhScRWPzjQifX141NAjOrW2x7ULbEuteY1Of8hbeEqnHMlwwytUE9xZZQEgm6wbkp4R mx+OwyX86MeiF/yX4fw4ZVJWirE4EL1CafOGUGH2S0RAUFNW3sdaWsKj1S+QO0vkDUMb GdMQ== X-Gm-Message-State: AGi0PuZ0xRvqzGox1PepEtVr2pvE8NzMW+H+k1sgW+ICpyans3vW2F2y QMIvCiGuKnxRE7d314LKPc3+/g== X-Google-Smtp-Source: APiQypItWeQCh4VuQPKDIWC8ZjlXOMK1Td48DeJ/E5GZYS7IzEcCDPmQ3cfILg8YZ2ZI69Pu9KJRNw== X-Received: by 2002:a63:c241:: with SMTP id l1mr3014492pgg.42.1587927488448; Sun, 26 Apr 2020 11:58:08 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h27sm9425153pgb.90.2020.04.26.11.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 11:58:08 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH 2/5] coresight: Mark some functions static Date: Sun, 26 Apr 2020 11:58:02 -0700 Message-Id: <20200426185805.14923-3-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200426185805.14923-1-swboyd@chromium.org> References: <20200426185805.14923-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200426_115809_404434_74A6BD7C X-CRM114-Status: GOOD ( 14.09 ) 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:541 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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: 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 These functions aren't used outside the file they're in. Mark them static to indicate as such and silence tools like sparse. Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd --- drivers/hwtracing/coresight/coresight-cti-platform.c | 3 +-- drivers/hwtracing/coresight/coresight-cti-sysfs.c | 2 +- drivers/hwtracing/coresight/coresight-cti.c | 6 +++--- drivers/hwtracing/coresight/coresight-etb10.c | 2 +- drivers/hwtracing/coresight/coresight-platform.c | 4 ++-- drivers/hwtracing/coresight/coresight-tmc.c | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c index 245f16c61af8..ab3bd4ed0910 100644 --- a/drivers/hwtracing/coresight/coresight-cti-platform.c +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c @@ -435,8 +435,7 @@ static int cti_plat_create_impdef_connections(struct device *dev, } /* get the hardware configuration & connection data. */ -int cti_plat_get_hw_data(struct device *dev, - struct cti_drvdata *drvdata) +static int cti_plat_get_hw_data(struct device *dev, struct cti_drvdata *drvdata) { int rc = 0; struct cti_device *cti_dev = &drvdata->ctidev; diff --git a/drivers/hwtracing/coresight/coresight-cti-sysfs.c b/drivers/hwtracing/coresight/coresight-cti-sysfs.c index bed460541f15..7da846a3a829 100644 --- a/drivers/hwtracing/coresight/coresight-cti-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-cti-sysfs.c @@ -1146,7 +1146,7 @@ static int cti_create_con_attr_set(struct device *dev, int con_idx, } /* create the array of group pointers for the CTI sysfs groups */ -int cti_create_cons_groups(struct device *dev, struct cti_device *ctidev) +static int cti_create_cons_groups(struct device *dev, struct cti_device *ctidev) { int nr_groups; diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers/hwtracing/coresight/coresight-cti.c index aa6e0249bd70..aac9a0d91e19 100644 --- a/drivers/hwtracing/coresight/coresight-cti.c +++ b/drivers/hwtracing/coresight/coresight-cti.c @@ -19,7 +19,7 @@ */ /* net of CTI devices connected via CTM */ -LIST_HEAD(ect_net); +static LIST_HEAD(ect_net); /* protect the list */ static DEFINE_MUTEX(ect_mutex); @@ -578,12 +578,12 @@ int cti_disable(struct coresight_device *csdev) return cti_disable_hw(drvdata); } -const struct coresight_ops_ect cti_ops_ect = { +static const struct coresight_ops_ect cti_ops_ect = { .enable = cti_enable, .disable = cti_disable, }; -const struct coresight_ops cti_ops = { +static const struct coresight_ops cti_ops = { .ect_ops = &cti_ops_ect, }; diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index 3810290e6d07..03e3f2590191 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -717,7 +717,7 @@ static const struct attribute_group coresight_etb_mgmt_group = { .name = "mgmt", }; -const struct attribute_group *coresight_etb_groups[] = { +static const struct attribute_group *coresight_etb_groups[] = { &coresight_etb_group, &coresight_etb_mgmt_group, NULL, diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index 43418a2126ff..8639f6981794 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -501,7 +501,7 @@ static inline bool acpi_validate_dsd_graph(const union acpi_object *graph) } /* acpi_get_dsd_graph - Find the _DSD Graph property for the given device. */ -const union acpi_object * +static const union acpi_object * acpi_get_dsd_graph(struct acpi_device *adev) { int i; @@ -564,7 +564,7 @@ acpi_validate_coresight_graph(const union acpi_object *cs_graph) * Returns the pointer to the CoreSight Graph Package when found. Otherwise * returns NULL. */ -const union acpi_object * +static const union acpi_object * acpi_get_coresight_graph(struct acpi_device *adev) { const union acpi_object *graph_list, *graph; diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index 1cf82fa58289..39fba1d16e6e 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -361,7 +361,7 @@ static const struct attribute_group coresight_tmc_mgmt_group = { .name = "mgmt", }; -const struct attribute_group *coresight_tmc_groups[] = { +static const struct attribute_group *coresight_tmc_groups[] = { &coresight_tmc_group, &coresight_tmc_mgmt_group, NULL, From patchwork Sun Apr 26 18:58:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11510929 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 421A3913 for ; Sun, 26 Apr 2020 18:59:08 +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 1135F20700 for ; Sun, 26 Apr 2020 18:59:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tycUTmZt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CKExp35R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1135F20700 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=YvYhXtV8wnljUSJZPt+14zv3uA/aKEjWo+BofWjjkog=; b=tycUTmZt0Yxoom mQxJBn3JFf5NpRPAapjRLnGcTdLHUvJ0MQ3/PQZMjM61Nfu9r5HJm6SvN9Q69NOEFFClFFTLUslAv +UK7Zx6u8h7sxXJrXSnbSLgIW1KAsAiLJc4SQirPxHpJwqkFNQwUj2y6hBXYUGkWEOgNBQ1lelCbc 7hNpJhThp7c/5Kl82ovA0wlf/IZU1y9lFu9/IrJCCVJDo8XMiZ07z0bp83iuAUTyEaYcfZMOJI6W8 q11wU6vhylkHX2MFdtUj6KcWG9ziyKUVz4TISOwhA8FRRZ6jfbCnzS91Amzgk/Dx6qMfUWeT+gQAy NIyvhASKgCWkX2sse4zw==; 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 1jSmUa-0006jm-Fh; Sun, 26 Apr 2020 18:59:04 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSmTi-00060B-Ga for linux-arm-kernel@lists.infradead.org; Sun, 26 Apr 2020 18:58:12 +0000 Received: by mail-pl1-x643.google.com with SMTP id t7so112503plr.0 for ; Sun, 26 Apr 2020 11:58:09 -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=l3i2flU80gai+judhhFKuvAvWyLfx9zeA9RGlgxWN5Q=; b=CKExp35RH6rrVYZf5vXfCon5651RmZbjoQsxKk1snxxhRAjxDEi5orr4cksepYMVpD 1DQHiFpDBFUnh35DM04PSq8snNIsDjS4BOXIpMEzU0W4IVSQ/g8InAvfISr19ju4oGLV CIOT9LzT7Wsbd0uphG4020IVfSNaBCsWylkbY= 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=l3i2flU80gai+judhhFKuvAvWyLfx9zeA9RGlgxWN5Q=; b=VwiNu3R8mZZt/qtl9+c8QAt1G9R26aBbqwuYdFhHM+U9hQTVjS/6FvBPIoel5oDiF0 cx3BSnVRNuQOsyTE0MUgHF+VAIBUmESoThTJXsskEm/mx1/SkZp5S7sx9K6f5NSHlHpY RVvcIgcdba1wy437mGaEshjn0XHKn7lrGxGpEREXVYY6BxnC6X3HCf8oOfbY2D06Rt2Q /xP+24sJTEHQf5GyC+vQzhiwRtVPK0dPMZLpR2j6ZtnMreEZrbnQ0bFksi/pcMEy4Mj+ CXNEbbmO7Rrf4NaCnS4ezhmfX17KADtYE3puaXjc5/v5WsfQOllurOFgeS9K6gAo31p7 iNag== X-Gm-Message-State: AGi0Pub9wfXPTcJfI8MEkuYgouRYDHV8LmdKYqydkBSJwK1QKVOxaDMp tsFS1qM9DkClsyk/NJTxE/BP3Q== X-Google-Smtp-Source: APiQypL2aZCoe1BGEmB9HPKQE18g7LHRDsJ4fzgjvL2I+3C29fpVwxnrx/b12/hGVqc9MH0v0Mu/Uw== X-Received: by 2002:a17:90a:b884:: with SMTP id o4mr18991300pjr.8.1587927489319; Sun, 26 Apr 2020 11:58:09 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h27sm9425153pgb.90.2020.04.26.11.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 11:58:08 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH 3/5] coresight: Don't initialize variables unnecessarily Date: Sun, 26 Apr 2020 11:58:03 -0700 Message-Id: <20200426185805.14923-4-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200426185805.14923-1-swboyd@chromium.org> References: <20200426185805.14923-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200426_115810_583498_49906BD7 X-CRM114-Status: GOOD ( 11.89 ) 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:643 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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: 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 These variables are assigned again before they're used. Leave them unassigned at first so that the compiler can detect problems in the future with use before initialization. Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd --- drivers/hwtracing/coresight/coresight-cti-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti-sysfs.c b/drivers/hwtracing/coresight/coresight-cti-sysfs.c index 7da846a3a829..77e14e770806 100644 --- a/drivers/hwtracing/coresight/coresight-cti-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-cti-sysfs.c @@ -1043,8 +1043,8 @@ static int cti_create_con_sysfs_attr(struct device *dev, enum cti_conn_attr_type attr_type, int attr_idx) { - struct dev_ext_attribute *eattr = 0; - char *name = 0; + struct dev_ext_attribute *eattr; + char *name; eattr = devm_kzalloc(dev, sizeof(struct dev_ext_attribute), GFP_KERNEL); @@ -1163,8 +1163,8 @@ static int cti_create_cons_groups(struct device *dev, struct cti_device *ctidev) int cti_create_cons_sysfs(struct device *dev, struct cti_drvdata *drvdata) { struct cti_device *ctidev = &drvdata->ctidev; - int err = 0, con_idx = 0, i; - struct cti_trig_con *tc = NULL; + int err, con_idx = 0, i; + struct cti_trig_con *tc; err = cti_create_cons_groups(dev, ctidev); if (err) From patchwork Sun Apr 26 18:58:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11510939 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 E62C915AB for ; Sun, 26 Apr 2020 18:59:23 +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 C14FE2071C for ; Sun, 26 Apr 2020 18:59:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A8qYLda/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bz50d4RF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C14FE2071C 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=d7EXup/HATnalcXRmRne56QfVv7VMtbqeScFtyXZXek=; b=A8qYLda/gx94rT 3g3zYScqsfjB+atZeiTXAD1z1SCJsmner3+xLDtu9sQf5AuxHEAXpEwZaUbRCuXRd0DlC1GwVMUWH SRymzWA14c/7vFnkNZwzpTIciZarRJGVXn0vByKKjnuTjYsXsGdPneW2zFlnMFCHXMeJqvjhRVchF jtVtxAtrTV2HusCK97YKYu7wmt+Q6hZV06Dh/zRxco/v0Srdy+Bgpzr988WWHG0XHZpSzQNL0SZsB ZgDD5JrWvPJcLYq6jm22FmvVR264u6iDHO84E3XYacw970WLLvgaSRgT2LjrKKTllQUHJooEoKJKA cGkEb6P410AktOt4d/dQ==; 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 1jSmUo-0006z0-AC; Sun, 26 Apr 2020 18:59:18 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSmTj-00060p-9Q for linux-arm-kernel@lists.infradead.org; Sun, 26 Apr 2020 18:58:13 +0000 Received: by mail-pl1-x641.google.com with SMTP id c21so5218785plz.4 for ; Sun, 26 Apr 2020 11:58:10 -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=gpZt5E1cSry4QDL3jmZLHdrOTZu3mS+7CXPfuznfxa0=; b=bz50d4RFZxXlsiYmc7eURFKnPKA8T97a4cJLMR9MKiedXJK661qh2I+r0rKGBepfSu dI0iNH4GSNHq7CJKJKinUa1pL3VmdVdxyoDAoum4WFs9CkQ5nsUaWc90rCKNPhIBv2C7 pxn8MIthIPm3ObUUy5SyaegcU/VqLPeW3FRc8= 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=gpZt5E1cSry4QDL3jmZLHdrOTZu3mS+7CXPfuznfxa0=; b=mU4sd3xYChNx2DvG6Vhpo/A4ntVYz4XZykf2WdAAsel62s83W50znmxPDPXdKTM3PG ZCuMzW5Nd98NfM+WGiNv0POjLGk9zJkxxro7iEMChDSLTmA9AIKi3VZcYZJtarCHnxQ+ XLfttuoWrRCy5QNmTkx6ibOIq3eK7Bj8SR4+lkay+WqDFUYAvtxPzraLb0ri/6haMHAf qBlppgVbiuAVsDDm90my893VcPZcN/jNxKT8l07+mBU9telNp9rnSD4kY8V9QM3aMG8o dDnUDxJkdbmcFyRihphPbQ4eIvNOIvnzZjpmVlojPFOaIIOfzQ5I8MLGdfQkDyhaNDqu /IRw== X-Gm-Message-State: AGi0Pubs96aMCUscVyGEFOTPRT1pfWcevoTYfnckyBJDODzlj7e4PqyV C+M75Z+QQu9K1jWZarK6hViD4jcMS0M= X-Google-Smtp-Source: APiQypLSk4G4qJYhxhL3iDl2db9jRsm+BPlCR5fOXBSFr23B/iAKgpxCxjBmCxA4xcH9swcCmtX5tw== X-Received: by 2002:a17:90a:9295:: with SMTP id n21mr19939827pjo.195.1587927490198; Sun, 26 Apr 2020 11:58:10 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h27sm9425153pgb.90.2020.04.26.11.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 11:58:09 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH 4/5] coresight: Initialize arg in sparse friendly way Date: Sun, 26 Apr 2020 11:58:04 -0700 Message-Id: <20200426185805.14923-5-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200426185805.14923-1-swboyd@chromium.org> References: <20200426185805.14923-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200426_115811_340059_F6912FCD X-CRM114-Status: GOOD ( 12.37 ) 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:641 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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: 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 Sparse gets annoyed when this initializer is 0 but the first struct member is a pointer. Just use { } to initialize instead so that sparse is quiet. Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd --- drivers/hwtracing/coresight/coresight-etm3x.c | 2 +- drivers/hwtracing/coresight/coresight-etm4x.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index e2cb6873c3f2..bf22dcfd3327 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -504,7 +504,7 @@ static int etm_enable_perf(struct coresight_device *csdev, static int etm_enable_sysfs(struct coresight_device *csdev) { struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - struct etm_enable_arg arg = { 0 }; + struct etm_enable_arg arg = { }; int ret; spin_lock(&drvdata->spinlock); diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index a90d757f7043..0f850efc1c82 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -412,7 +412,7 @@ static int etm4_enable_perf(struct coresight_device *csdev, static int etm4_enable_sysfs(struct coresight_device *csdev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - struct etm4_enable_arg arg = { 0 }; + struct etm4_enable_arg arg = { }; int ret; spin_lock(&drvdata->spinlock); From patchwork Sun Apr 26 18:58:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11510945 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 1F2BD14DD for ; Sun, 26 Apr 2020 18:59:37 +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 F15B82070A for ; Sun, 26 Apr 2020 18:59:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LVZnSEs3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="J6yKsPTd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F15B82070A 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=AGn62zkafy95Wl9z7yz48WxMq2VZUrO01ZELJCBy1m0=; b=LVZnSEs3Wxz956 W59V/xWynIUHqeYSzpV+cQQVsaEf5IcB7yPS7ditCO9lajDZgghdgY3pchtnrnsJ/E4BtrUM1RrLW hJsXJV5HveuNybKmfQYbAW2B9HROxV3iG9hStTluCvWfuWwRUphoMWug7GpPFX3QhUuYbS3k9S4f5 bg1mJLPFaJebpkXGdD4M887/Wb06/QRZUVDi08Nrx3WjGA5cZHqoN8GWyHlpZmlimtDSGvAQA/zLC dYEAGaF0thpoG+IXVLhEaxlZ66Io/0wEiYZWb7vXT4WXi2C+ssnCdx2tcUsP5peawfwfC/cpXLA1P 7zdawUH/KkKVIgS8huNQ==; 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 1jSmV2-0007EY-47; Sun, 26 Apr 2020 18:59:32 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSmTj-000626-Vj for linux-arm-kernel@lists.infradead.org; Sun, 26 Apr 2020 18:58:14 +0000 Received: by mail-pf1-x441.google.com with SMTP id x77so7717362pfc.0 for ; Sun, 26 Apr 2020 11:58:11 -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=78YVO845GHtM9k/EV5ps+BQFILd3wygw5mUyH2gxrzc=; b=J6yKsPTdcbwo6aeshqFM2fAYsDMjgIQoQY8MwtukCyc4TyT2VnzLqAzlU/0CsbKoW0 jtWf8aRzBoPBaJZJBm1Lg+ZwGPOLaTZucHMHdK9h0RYCvOGpspXp0ASBXuEkVePJptFa iDwfjCbDMnNVvSzMf9JR3S9E1iv5lWAGje84A= 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=78YVO845GHtM9k/EV5ps+BQFILd3wygw5mUyH2gxrzc=; b=fdQ8eEVIMhkjs5l+fL6Cax7S7t4hB0UzEraugGIkWz6GGjUoHecFeQhz1fqpHg89ke DHMobk6hSgoDelzB7kw5CmlCVTJ7nGT8ZG4OmOyRE4KJNu/qloqDBFW5iW6UuVTqLrzQ p8LM5ZP6YCaPk8gutq6MM98Lp9OFX/0i48mPY0ruST/NIhsAoa2aREHAnsAl8pWkCN/1 4B3PpWZjt21c0XSqZKtbs6bo/KMKtKrYh5DVaSafAR58hIPgCztAlrhzU/MZm0yAq3lP ncYxdAdzXkKhyRduzUzaC/wo2QyaoIztAMvCr0CW0l/iXLKZd9SjvbGqCj/H7F/qGtfI o/VA== X-Gm-Message-State: AGi0Pub9cgWJJHDurboLlzH7nwF4tNZTq48G+JDmGIg+PIzMCXM4x73w C1KIuuOyV6a/Wov2lSAqK/c/ew== X-Google-Smtp-Source: APiQypLIflSfGaQ/fc5lB1P41nB7JmBS+mGiXUpgYwets4rk7M766rmw/tGYvSbMSRiW/JEWTQ+P2w== X-Received: by 2002:a63:cf10:: with SMTP id j16mr19176908pgg.201.1587927491023; Sun, 26 Apr 2020 11:58:11 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h27sm9425153pgb.90.2020.04.26.11.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 11:58:10 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH 5/5] coresight: Avoid casting void pointers Date: Sun, 26 Apr 2020 11:58:05 -0700 Message-Id: <20200426185805.14923-6-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200426185805.14923-1-swboyd@chromium.org> References: <20200426185805.14923-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200426_115812_067720_58724295 X-CRM114-Status: GOOD ( 11.70 ) 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:441 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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: 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 Signed-off-by: Stephen Boyd --- 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 890f9a5c97c6..09ca9d824cee 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -206,9 +206,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 id->data; + + return NULL; } void coresight_release_platform_data(struct coresight_platform_data *pdata);