From patchwork Mon Jul 18 19:51:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 72246 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp290764qga; Mon, 18 Jul 2016 12:51:52 -0700 (PDT) X-Received: by 10.98.107.129 with SMTP id g123mr48687004pfc.62.1468871512447; Mon, 18 Jul 2016 12:51:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si5016786pfi.276.2016.07.18.12.51.52; Mon, 18 Jul 2016 12:51:52 -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; dkim=pass header.i=@linaro.org; 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752260AbcGRTvl (ORCPT + 29 others); Mon, 18 Jul 2016 15:51:41 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:35052 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbcGRTvh (ORCPT ); Mon, 18 Jul 2016 15:51:37 -0400 Received: by mail-io0-f181.google.com with SMTP id m101so363066ioi.2 for ; Mon, 18 Jul 2016 12:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=q0ZRzbw9Zb7yajpYCY1TXIE4EDHH/lIbalB6mghPILY=; b=CshOtIx1InmmZLvcQANbhigrMxmeYXfOndUIT9rR2O71xdadG28Jth4aKDcaPnUd/g Jg62J4IODvtB4Txhf8Lg3Kq6vUwxNtAmT75D11m+nF57qBHNZfnwxlJhUm6vTtJ3aZUz k6ZVqyx0Xpeu/5OaYd6wWRrWLZdIUNlSpbAqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=q0ZRzbw9Zb7yajpYCY1TXIE4EDHH/lIbalB6mghPILY=; b=gImu4DxgrujxWRxy+1BAagR1wg/JHzvV9OCbEjgPwERvtcOQzS3adydwPbN0Fqc2MK IUSnCNciCxiAqUdE47o0uYFuW1XOyUIT3L/EEq7pOm+vrBBdjXH135SNsrCG55BceAwA IrNyVKKP61EBZPnl042cvFzxjr8iw7K2RI7JtS4uLdrVibE9uyvi+YJdjirZ2DSS8+pu ngMbuAvF4zYx0HxPPyfYzdnCHLXXchL4N1jIR3bMHLJEIJTPhWug6O47ewYK3RhaT0NB L+HSJXzxan3uR2SLxL2B9H+LTDSpMok3jb0buP8wnUdfR5tdSQ1S+oDdCsWrAjRiYqor av8Q== X-Gm-Message-State: ALyK8tLOMjH0IrfiNX+o4cjH6EQSjLlSeieWohTBgGV2Pj5X3PcA3IYdM8+J+UWWHKHNU6Av X-Received: by 10.107.198.147 with SMTP id w141mr35837880iof.146.1468871496172; Mon, 18 Jul 2016 12:51:36 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r128sm5270676ita.6.2016.07.18.12.51.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 12:51:35 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, Mathieu Poirier Subject: [PATCH 02/10] coresight: remove duplicated enumeration Date: Mon, 18 Jul 2016 13:51:23 -0600 Message-Id: <1468871491-10997-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org> References: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both ETMv3 and ETMv4 drivers are declaring an 'enum etm_addr_type', creating reduncancy. This patch removes the enumeration from the driver files and adds it to a common header. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm.h | 8 -------- drivers/hwtracing/coresight/coresight-etm3x-sysfs.c | 1 + drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 1 + drivers/hwtracing/coresight/coresight-etm4x.h | 8 -------- drivers/hwtracing/coresight/coresight-priv.h | 8 ++++++++ 5 files changed, 10 insertions(+), 16 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etm.h b/drivers/hwtracing/coresight/coresight-etm.h index 51597cb2c08a..4a18ee499965 100644 --- a/drivers/hwtracing/coresight/coresight-etm.h +++ b/drivers/hwtracing/coresight/coresight-etm.h @@ -259,14 +259,6 @@ struct etm_drvdata { struct etm_config config; }; -enum etm_addr_type { - ETM_ADDR_TYPE_NONE, - ETM_ADDR_TYPE_SINGLE, - ETM_ADDR_TYPE_RANGE, - ETM_ADDR_TYPE_START, - ETM_ADDR_TYPE_STOP, -}; - static inline void etm_writel(struct etm_drvdata *drvdata, u32 val, u32 off) { diff --git a/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c index 02d4b629891f..3f73cee7a094 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c @@ -18,6 +18,7 @@ #include #include #include "coresight-etm.h" +#include "coresight-priv.h" static ssize_t nr_addr_cmp_show(struct device *dev, struct device_attribute *attr, char *buf) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index 7c84308c5564..6ae26ffeaefd 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -18,6 +18,7 @@ #include #include #include "coresight-etm4x.h" +#include "coresight-priv.h" static int etm4_set_mode_exclude(struct etmv4_drvdata *drvdata, bool exclude) { diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 5359c5197c1d..111f4bb3a6b2 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -407,14 +407,6 @@ enum etm_addr_ctxtype { ETM_CTX_CTXID_VMID, }; -enum etm_addr_type { - ETM_ADDR_TYPE_NONE, - ETM_ADDR_TYPE_SINGLE, - ETM_ADDR_TYPE_RANGE, - ETM_ADDR_TYPE_START, - ETM_ADDR_TYPE_STOP, -}; - extern const struct attribute_group *coresight_etmv4_groups[]; void etm4_config_trace_mode(struct etmv4_config *config); #endif diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index 3cb574b3cdd9..1f6b580ef1c4 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -47,6 +47,14 @@ static ssize_t name##_show(struct device *_dev, \ } \ static DEVICE_ATTR_RO(name) +enum etm_addr_type { + ETM_ADDR_TYPE_NONE, + ETM_ADDR_TYPE_SINGLE, + ETM_ADDR_TYPE_RANGE, + ETM_ADDR_TYPE_START, + ETM_ADDR_TYPE_STOP, +}; + enum cs_mode { CS_MODE_DISABLED, CS_MODE_SYSFS,