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 X-Patchwork-Id: 50058 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACACB228CC for ; Thu, 18 Jun 2015 22:36:24 +0000 (UTC) Received: by wibdt2 with SMTP id dt2sf584465wib.3 for ; Thu, 18 Jun 2015 15:36:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=ZZ70S/Gu3W201Vx9kGLeNfWDjiFMpKQNogmY7GNAG3s=; b=SBSJy/SotF6DdWzUgRWB8BKlU5JR80TWVbfDU3lqZLAilHWRJJu6JEsbkX+R0a1umV O7hD5NSqP1j0C+uQyWsMHkQ6akys/nLEpluQR+4Fdu0kA6r1bq3cSuriJAW/JX10gZx3 uk/Bz6E7hSfkJ/mlRWYcKBGWyCrIPUmej+xzRZ6q2oLL8MmIW94egXTRaxjs2Z/4MLQQ 3m+7EDxYFKJAoryLMwHWCZoeG77JHMb1+aFp6ig8MPVwsso2rd8DbAPQyp8maJxUaOgN rR61OU9/3OuBjIwkrckL+eYwAwj65gn4mAYPeLTLCM+xUFyNLXZ5UVMNKJN0yLOWwAqQ Rpcw== X-Gm-Message-State: ALoCoQm11IhgIzwnwmbBJ8jgJBXt9/REH+CCuu1yxlFNSBr13/ITGQNY/95Db370C+fFdPaL9aV0 X-Received: by 10.112.162.228 with SMTP id yd4mr12124579lbb.8.1434666983995; Thu, 18 Jun 2015 15:36:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.197 with SMTP id d5ls458021lah.97.gmail; Thu, 18 Jun 2015 15:36:23 -0700 (PDT) X-Received: by 10.112.50.230 with SMTP id f6mr14857798lbo.17.1434666983723; Thu, 18 Jun 2015 15:36:23 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id l5si7456800lbt.73.2015.06.18.15.36.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 15:36:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so61132360lbb.3 for ; Thu, 18 Jun 2015 15:36:23 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr14916748lae.19.1434666983601; Thu, 18 Jun 2015 15:36:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp148421lbb; Thu, 18 Jun 2015 15:36:22 -0700 (PDT) X-Received: by 10.50.30.9 with SMTP id o9mr533824igh.36.1434666982139; Thu, 18 Jun 2015 15:36:22 -0700 (PDT) Received: from mail-ie0-f173.google.com (mail-ie0-f173.google.com. [209.85.223.173]) by mx.google.com with ESMTPS id ag10si7768100icc.25.2015.06.18.15.36.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 15:36:22 -0700 (PDT) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.223.173 as permitted sender) client-ip=209.85.223.173; Received: by iebmu5 with SMTP id mu5so64260190ieb.1 for ; Thu, 18 Jun 2015 15:36:21 -0700 (PDT) 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 Cc: rjw@rjwysocki.net, lenb@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, tglx@linutronix.de, jason@lakedaemon.net, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;