linux内核API在不断更新迭代,如何查看函数API在何时被修改?例:pci_cleanup_aer_uncorrect_error_status函数
查看函数在哪次提交修改
使用Git History插件查看提交日志中关于pci_cleanup_aer_uncorrect_error_status的信息
点击previous,查看提交对比,确认是在894020fdd88c1e9a74c60b67c0f19f1c7696ba2f提交修改的函数
查看函数在什么版本修改
使用git show命令查看提交时的版本
$ git show 894020fdd88c1e9a74c60b67c0f19f1c7696ba2f:Makefile
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 6
SUBLEVEL = 0
EXTRAVERSION = -rc1
NAME = Kleptomaniac Octopus
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
# More info can be located in ./README
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.
# That's our default target when none is given on the command line
驱动兼容处理
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
pci_aer_clear_nonfatal_status(pdev);
#else
pci_cleanup_aer_uncorrect_error_status(pdev);
#endif
关注博主公众号,优质文章不断更新