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 <[email protected]>
[ Minor stylistic cleanup. ]
Cc: Bjorn Helgaas <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
Andy Shevchenko
2018-02-23 08:20:30 +01:00
committed by Ingo Molnar
parent 24e8db62c1
commit 492a1abd61
+9
View File
@@ -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__ */