From patchwork Thu Jun 11 19:45:09 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: 6591551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D965A9F443 for ; Thu, 11 Jun 2015 19:48:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFBB220636 for ; Thu, 11 Jun 2015 19:48:42 +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 1DB4F2055D for ; Thu, 11 Jun 2015 19:48:42 +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 1Z38QK-0004vp-BY; Thu, 11 Jun 2015 19:46:00 +0000 Received: from mail-ig0-f182.google.com ([209.85.213.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z38Q8-0004q8-QK for linux-arm-kernel@lists.infradead.org; Thu, 11 Jun 2015 19:45:49 +0000 Received: by igbsb11 with SMTP id sb11so11639769igb.0 for ; Thu, 11 Jun 2015 12:45:26 -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=P9wGaRAqyKqmaTZHRCgUV3rNH1bz5p78VDCuim2Q0uk=; b=VVS3xp7V9eJW/5aSjQNh28rAk/j4deCxXLgjOLXrWqMu0ZGBMjf6++dLOyk79XFQw1 uxKfr2CHkWsEB/WB4iYjJr1nVOjhbvyulEedcpb9LHSUjZw+EXp+9CqPhIjlsikxTs5r Am4bU+yaQmY9keOx9YX/6lF4ZyicmHqOUh+bx3fOakT5Tg4ExsLFePHgCoKWwr5yFj1i wh/hCPWSubEHWy8T3e7dFdx0kea57pCICZvrXdeq0PM2hwy+rDHyWSUjbdb38tJpgYrZ VGQNlrLUKECw1CTy0HR4mztYQJPjUrBvICTp+QfqYepJy7mrmlXO4xd1v8R4Y6Mz5UbM kTRg== X-Gm-Message-State: ALoCoQmfUYC6FxCQ2H/92eNAQMYtbfFeB6FKfUYzNGtJSdDUPtJ3zm2w+hpXN3CvZrrvn3/RHtbN X-Received: by 10.107.169.157 with SMTP id f29mr13547471ioj.74.1434051926573; Thu, 11 Jun 2015 12:45:26 -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 z195sm1009685iod.33.2015.06.11.12.45.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 12:45:25 -0700 (PDT) From: al.stone@linaro.org To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ACPI: introduce macros for using the ACPI specification version Date: Thu, 11 Jun 2015 13:45:09 -0600 Message-Id: <1434051911-14665-2-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1434051911-14665-1-git-send-email-al.stone@linaro.org> References: <1434051911-14665-1-git-send-email-al.stone@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150611_124548_928752_54B7D17D X-CRM114-Status: UNSURE ( 8.63 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.8 (+) Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, linaro-acpi@lists.linaro.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=-1.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, SUSPICIOUS_RECIPS,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no 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 From: Al Stone 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 Reviewed-by: Graeme Gregory CC: Rafael J. Wysocki CC: Len Brown --- 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;