mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01: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 <[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:
1 parent
24e8db62c1
commit
492a1abd61
1 file changed
+9
@@ -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__ */
|
||||
Reference in new issue
Block a user