Received: by 10.192.165.148 with SMTP id m20csp4713327imm; Tue, 1 May 2018 02:18:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrVzzsIxKAw9sUqslfx/awTZCHwLqz8OUnOMSFhZCxjI/JeXGoInwZItoeNPEdkz9D4HRyI X-Received: by 10.98.150.92 with SMTP id c89mr15002368pfe.37.1525166333859; Tue, 01 May 2018 02:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525166333; cv=none; d=google.com; s=arc-20160816; b=E8ovyQNhc6H7kutvpyy8i3k/Ky88kaUlsOsFyWTigoxbIAdWpYAfpGn0jb3uturjIU BXqRTlJzd06C021EtUgWopK9sPD+wmtaIvCY2qtb0ov85FZoz5/heXV1FCRuHcDtXzWr VBfgEYi+FOAfPWprcha4z05Zy39zk6GHkQvPFsGlzItHN3LTRXx1vqHrkj0lsptwy3GX dNC5ZYH2njz5QQnQOPRiiGxlqJUhF7mIpm7Id4a09SygSV/VNyYpMloFBfvT67gAvS/o 5CXxU38GCmIiB6nQ4gvhgXwl3GolEcK0cNX/Gsn7leLQyykgV7CynUuGF86Csj1GmuLz 84xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=odHULNT1BO22mC3UfQNsb7SoMhOBUsrEVJu4i+xHyUM=; b=MsjtBeswnkBO2OYswup+2Oe1v9Pu1JnQbRXfYmCN1acuFsGF8kDv81C7x2wdkcY6I8 3A/+I1b9Pl6CKTQuaWTfQ7kL5eVhbFrErZDGvQNGbvwjSaR9LfvRvsThoE+GExLJ4KU9 kNyKGi9j6VpU4+sOxJIyhlqv2McSjp3fbOlKexfO3qVn7G62A+Vo9/6gaAVpt11RjvFF +j+JvXj8Lforul7MBPgQxnc9qfqHqbmlWEY3eDd6H5sPIuCqUEWSCX1Q8xdjJheaU/MU pVqOdlNYbs+1rk/Y0EwolpKWhe3dGSR0EigDCAuPpmnLoUP3YuPRDwH6HBcJUCWZ8eQx UIkw== 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 p5-v6si7539350pgr.472.2018.05.01.02.18.39; Tue, 01 May 2018 02:18:53 -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 S1754734AbeEAJRu (ORCPT + 99 others); Tue, 1 May 2018 05:17:50 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44036 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751071AbeEAJLN (ORCPT ); Tue, 1 May 2018 05:11:13 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 583F215B2; Tue, 1 May 2018 02:11:13 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.206.73]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 24B963F487; Tue, 1 May 2018 02:11:11 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, robert.walker@arm.com, mark.rutland@arm.com, will.deacon@arm.com, robin.murphy@arm.com, sudeep.holla@arm.com, frowand.list@gmail.com, robh@kernel.org, john.horley@arm.com, Suzuki K Poulose Subject: [PATCH v2 02/27] coresight: Cleanup device subtype struct Date: Tue, 1 May 2018 10:10:32 +0100 Message-Id: <1525165857-11096-3-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525165857-11096-1-git-send-email-suzuki.poulose@arm.com> References: <1525165857-11096-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up our struct a little bit by using a union instead of a struct for tracking the subtype of a device. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- include/linux/coresight.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/include/linux/coresight.h b/include/linux/coresight.h index d950dad..556fe59 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -70,17 +70,20 @@ enum coresight_dev_subtype_source { }; /** - * struct coresight_dev_subtype - further characterisation of a type + * union coresight_dev_subtype - further characterisation of a type * @sink_subtype: type of sink this component is, as defined - by @coresight_dev_subtype_sink. + * by @coresight_dev_subtype_sink. * @link_subtype: type of link this component is, as defined - by @coresight_dev_subtype_link. + * by @coresight_dev_subtype_link. * @source_subtype: type of source this component is, as defined - by @coresight_dev_subtype_source. + * by @coresight_dev_subtype_source. */ -struct coresight_dev_subtype { - enum coresight_dev_subtype_sink sink_subtype; - enum coresight_dev_subtype_link link_subtype; +union coresight_dev_subtype { + /* We have some devices which acts as LINK and SINK */ + struct { + enum coresight_dev_subtype_sink sink_subtype; + enum coresight_dev_subtype_link link_subtype; + }; enum coresight_dev_subtype_source source_subtype; }; @@ -120,7 +123,7 @@ struct coresight_platform_data { */ struct coresight_desc { enum coresight_dev_type type; - struct coresight_dev_subtype subtype; + union coresight_dev_subtype subtype; const struct coresight_ops *ops; struct coresight_platform_data *pdata; struct device *dev; @@ -164,7 +167,7 @@ struct coresight_device { int nr_inport; int nr_outport; enum coresight_dev_type type; - struct coresight_dev_subtype subtype; + union coresight_dev_subtype subtype; const struct coresight_ops *ops; struct device dev; atomic_t *refcnt; -- 2.7.4