linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Natarajan, Janakarajan" <Janakarajan.Natarajan@amd.com>
To: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"devel@acpica.org" <devel@acpica.org>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Robert Moore <robert.moore@intel.com>,
	Erik Schmauss <erik.schmauss@intel.com>,
	"Ghannam, Yazen" <Yazen.Ghannam@amd.com>,
	"Natarajan, Janakarajan" <Janakarajan.Natarajan@amd.com>
Subject: [PATCH v2 1/7] acpi/cppc: Add macro for CPPC register BUFFER only check
Date: Thu, 4 Apr 2019 21:25:47 +0000	[thread overview]
Message-ID: <4eae43aeb96e379bbdd9cd2a040fe53c147bd412.1554410643.git.Janakarajan.Natarajan@amd.com> (raw)
In-Reply-To: <cover.1554410643.git.Janakarajan.Natarajan@amd.com>

CPC_SUP_BUFFER_ONLY ensures that an expected BUFFER only register has a
register type of ACPI_TYPE_BUFFER and is not NULL.

Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
---
 drivers/acpi/cppc_acpi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index d4244e7d0e38..56a09e057c4f 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -115,6 +115,14 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);
 #define CPC_SUPPORTED(cpc) ((cpc)->type == ACPI_TYPE_INTEGER ?		\
 				!!(cpc)->cpc_entry.int_value :		\
 				!IS_NULL_REG(&(cpc)->cpc_entry.reg))
+
+/*
+ * Evaluates to True if an optional cpc field is supported and is
+ * BUFFER only
+ */
+#define CPC_SUP_BUFFER_ONLY(cpc) ((cpc)->type == ACPI_TYPE_BUFFER &&	\
+				  !IS_NULL_REG(&(cpc)->cpc_entry.reg))
+
 /*
  * Arbitrary Retries in case the remote processor is slow to respond
  * to PCC commands. Keeping it high enough to cover emulators where
-- 
2.17.1


  reply	other threads:[~2019-04-04 21:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 21:25 [PATCH v2 0/7] CPPC optional registers AMD support Natarajan, Janakarajan
2019-04-04 21:25 ` Natarajan, Janakarajan [this message]
2019-04-04 21:25 ` [PATCH v2 2/7] acpi/cppc: Ensure only supported CPPC sysfs entries are created Natarajan, Janakarajan
2019-04-04 21:25 ` [PATCH v2 3/7] acpi/cppc: Modify show_cppc_data macro Natarajan, Janakarajan
2019-04-04 21:25 ` [PATCH v2 4/7] acpi/cppc: Rework cppc_set_perf() to use cppc_regs index Natarajan, Janakarajan
2019-04-04 21:25 ` [PATCH v2 5/7] acpi/cppc: Add macros to define a R/W sysfs entry for CPPC registers Natarajan, Janakarajan
2019-04-04 21:25 ` [PATCH v2 6/7] acpi/cppc: Add support for optional " Natarajan, Janakarajan
2019-04-04 21:25 ` [PATCH v2 7/7] acpi/cppc: Add support for CPPC Enable register Natarajan, Janakarajan
2019-04-15 22:35 ` [PATCH v2 0/7] CPPC optional registers AMD support Janakarajan Natarajan
2019-04-16  9:34   ` Rafael J. Wysocki
2019-04-17 17:28     ` Ghannam, Yazen
2019-04-17 22:10       ` Rafael J. Wysocki
2019-04-18 16:40         ` Ghannam, Yazen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4eae43aeb96e379bbdd9cd2a040fe53c147bd412.1554410643.git.Janakarajan.Natarajan@amd.com \
    --to=janakarajan.natarajan@amd.com \
    --cc=Yazen.Ghannam@amd.com \
    --cc=devel@acpica.org \
    --cc=erik.schmauss@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).