From patchwork Thu Jun 18 22:36:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: al.stone@linaro.org X-Patchwork-Id: 6641481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 62B2BC0020 for ; Thu, 18 Jun 2015 22:40:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A73C208A4 for ; Thu, 18 Jun 2015 22:40:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A93A62062F for ; Thu, 18 Jun 2015 22:40:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5iQZ-0008SH-NG; Thu, 18 Jun 2015 22:36:55 +0000 Received: from mail-ie0-f176.google.com ([209.85.223.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5iQM-0008Ou-Q1 for linux-arm-kernel@lists.infradead.org; Thu, 18 Jun 2015 22:36:43 +0000 Received: by iefd2 with SMTP id d2so7843226ief.2 for ; Thu, 18 Jun 2015 15:36:21 -0700 (PDT) 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=ZZ70S/Gu3W201Vx9kGLeNfWDjiFMpKQNogmY7GNAG3s=; b=G7qjQhea+jwKI0PGrqgft0QCY9x1J1bN58tzr7J9Qh2Ye/I6tGL/gB9lPsBiEe2sCc /loGtzp64StnwQwvapa/F8iLof2GNnOqsulXrmY2uXHyXXkyJ9pigxsfGYm31REWJUhB mrgfoqvtRkc3lR0dXp9oG8J1I6iWA7DYzb0sUI29ujH8ynN2GijBqkPdnGRbMBW4nwKH ndi3VU7IoR269NUzXF1XzK4O2JRmOqJ4LQ1szq2tkLOqxIhdQ8eS2b0hf5D0HAzZ/WHu gLjQp0Wj0Q5Ci5uEwdASLGWJWA7d/iIFwYnMq+LFHwkhQH35KIjec+xAaXmtoXX6d679 HB5Q== X-Gm-Message-State: ALoCoQlBLyTG98DE7/vFV5ul99Q+tVnZ2Hz3ZPva1LiyrCF9tV/GDJp02b0BHw4PqBWVdoTYuolA X-Received: by 10.42.167.129 with SMTP id s1mr8703408icy.54.1434666981334; Thu, 18 Jun 2015 15:36:21 -0700 (PDT) Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by mx.google.com with ESMTPSA id f82sm5828300ioj.37.2015.06.18.15.36.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 15:36:20 -0700 (PDT) From: Al Stone To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/3] ACPI : introduce macros for using the ACPI specification version Date: Thu, 18 Jun 2015 16:36:06 -0600 Message-Id: <1434666968-1543-2-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1434666968-1543-1-git-send-email-al.stone@linaro.org> References: <1434666968-1543-1-git-send-email-al.stone@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150618_153642_915280_0EEA457F X-CRM114-Status: UNSURE ( 8.52 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: linaro-kernel@lists.linaro.org, jason@lakedaemon.net, linaro-acpi@lists.linaro.org, catalin.marinas@arm.com, patches@linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, will.deacon@arm.com, tglx@linutronix.de, lenb@kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the ACPI_SPEC_VERSION() macro to build a proper version number from a major and minor revision number. Add also the ACPI_FADT_SPEC_VERSION that constructs a proper version number from the entries in the current FADT. These macros are added in order to simplify retrieving and comparing ACPI specification version numbers, since this is becoming a more frequent need. In particular, there are some architectures that require at least a certain version of the spec, and there are differences in some structure sizes that have changed with recent versions but can only be tracked by spec version number. Signed-off-by: Al Stone Reviewed-by: Hanjun Guo --- include/linux/acpi.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a4acb55..33ed313 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -48,6 +48,11 @@ #include #include +#define ACPI_SPEC_VERSION(major, minor) ((major<<8)|minor) +#define ACPI_FADT_SPEC_VERSION \ + ACPI_SPEC_VERSION(acpi_gbl_FADT.header.revision, \ + acpi_gbl_FADT.minor_revision) + static inline acpi_handle acpi_device_handle(struct acpi_device *adev) { return adev ? adev->handle : NULL;