mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-13 17:26:41 +07:00
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@linux.intel.com> [ Minor stylistic cleanup. ] Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Jean Delvare <jdelvare@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Thomas Gleixner <tglx@linutronix.de> 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 <mingo@kernel.org>
This commit is contained in:
parent
24e8db62c1
commit
492a1abd61
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user