From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751746AbeBWIZW (ORCPT ); Fri, 23 Feb 2018 03:25:22 -0500 Received: from terminus.zytor.com ([198.137.202.136]:39069 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbeBWIZU (ORCPT ); Fri, 23 Feb 2018 03:25:20 -0500 Date: Fri, 23 Feb 2018 00:24:45 -0800 From: tip-bot for Andy Shevchenko Message-ID: Cc: torvalds@linux-foundation.org, mingo@kernel.org, bhelgaas@google.com, hpa@zytor.com, linux-kernel@vger.kernel.org, rjw@rjwysocki.net, peterz@infradead.org, tglx@linutronix.de, jdelvare@suse.com, andriy.shevchenko@linux.intel.com Reply-To: andriy.shevchenko@linux.intel.com, rjw@rjwysocki.net, jdelvare@suse.com, peterz@infradead.org, tglx@linutronix.de, bhelgaas@google.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org In-Reply-To: <20180222125923.57385-1-andriy.shevchenko@linux.intel.com> References: <20180222125923.57385-1-andriy.shevchenko@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] dmi: Introduce the dmi_get_bios_year() helper function Git-Commit-ID: 492a1abd61e4b4f78c1c5804840a304a9e32da04 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 492a1abd61e4b4f78c1c5804840a304a9e32da04 Gitweb: https://git.kernel.org/tip/492a1abd61e4b4f78c1c5804840a304a9e32da04 Author: Andy Shevchenko AuthorDate: Thu, 22 Feb 2018 14:59:20 +0200 Committer: Ingo Molnar CommitDate: Fri, 23 Feb 2018 08:20:30 +0100 dmi: Introduce the dmi_get_bios_year() helper function The pattern to only extract the year portion of date is used in several places and more users may come. By using this helper they may create slightly cleaner code. Signed-off-by: Andy Shevchenko [ Minor stylistic cleanup. ] Cc: Bjorn Helgaas Cc: Jean Delvare Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Thomas Gleixner Cc: linux-acpi@vger.kernel.org Cc: linux-pci@vger.kernel.org Link: http://lkml.kernel.org/r/20180222125923.57385-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar --- include/linux/dmi.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 46e151172d95..0bade156e908 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -147,4 +147,13 @@ static inline const struct dmi_system_id * #endif +static inline int dmi_get_bios_year(void) +{ + int year; + + dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL); + + return year; +} + #endif /* __DMI_H__ */