[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-492a1abd61e4b4f78c1c5804840a304a9e32da04@git.kernel.org>
Date: Fri, 23 Feb 2018 00:24:45 -0800
From: tip-bot for Andy Shevchenko <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: torvalds@...ux-foundation.org, mingo@...nel.org,
bhelgaas@...gle.com, hpa@...or.com, linux-kernel@...r.kernel.org,
rjw@...ysocki.net, peterz@...radead.org, tglx@...utronix.de,
jdelvare@...e.com, andriy.shevchenko@...ux.intel.com
Subject: [tip:x86/platform] dmi: Introduce the dmi_get_bios_year() helper
function
Commit-ID: 492a1abd61e4b4f78c1c5804840a304a9e32da04
Gitweb: https://git.kernel.org/tip/492a1abd61e4b4f78c1c5804840a304a9e32da04
Author: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
AuthorDate: Thu, 22 Feb 2018 14:59:20 +0200
Committer: Ingo Molnar <mingo@...nel.org>
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 <andriy.shevchenko@...ux.intel.com>
[ Minor stylistic cleanup. ]
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Jean Delvare <jdelvare@...e.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rafael J. Wysocki <rjw@...ysocki.net>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-acpi@...r.kernel.org
Cc: linux-pci@...r.kernel.org
Link: http://lkml.kernel.org/r/20180222125923.57385-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
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__ */
Powered by blists - more mailing lists