check-headers.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/sh
  2. HEADERS='
  3. include/uapi/linux/fcntl.h
  4. include/uapi/linux/perf_event.h
  5. include/uapi/linux/stat.h
  6. include/linux/hash.h
  7. include/uapi/linux/hw_breakpoint.h
  8. arch/x86/include/asm/disabled-features.h
  9. arch/x86/include/asm/required-features.h
  10. arch/x86/include/asm/cpufeatures.h
  11. arch/arm/include/uapi/asm/perf_regs.h
  12. arch/arm64/include/uapi/asm/perf_regs.h
  13. arch/powerpc/include/uapi/asm/perf_regs.h
  14. arch/x86/include/uapi/asm/perf_regs.h
  15. arch/x86/include/uapi/asm/kvm.h
  16. arch/x86/include/uapi/asm/kvm_perf.h
  17. arch/x86/include/uapi/asm/svm.h
  18. arch/x86/include/uapi/asm/vmx.h
  19. arch/powerpc/include/uapi/asm/kvm.h
  20. arch/s390/include/uapi/asm/kvm.h
  21. arch/s390/include/uapi/asm/kvm_perf.h
  22. arch/s390/include/uapi/asm/sie.h
  23. arch/arm/include/uapi/asm/kvm.h
  24. arch/arm64/include/uapi/asm/kvm.h
  25. include/asm-generic/bitops/arch_hweight.h
  26. include/asm-generic/bitops/const_hweight.h
  27. include/asm-generic/bitops/__fls.h
  28. include/asm-generic/bitops/fls.h
  29. include/asm-generic/bitops/fls64.h
  30. include/linux/coresight-pmu.h
  31. include/uapi/asm-generic/mman-common.h
  32. '
  33. check () {
  34. file=$1
  35. opts=
  36. shift
  37. while [ -n "$*" ]; do
  38. opts="$opts \"$1\""
  39. shift
  40. done
  41. cmd="diff $opts ../$file ../../$file > /dev/null"
  42. test -f ../../$file &&
  43. eval $cmd || echo "Warning: $file differs from kernel" >&2
  44. }
  45. # simple diff check
  46. for i in $HEADERS; do
  47. check $i -B
  48. done
  49. # diff with extra ignore lines
  50. check arch/x86/lib/memcpy_64.S -B -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
  51. check arch/x86/lib/memset_64.S -B -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
  52. check include/uapi/asm-generic/mman.h -B -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
  53. check include/uapi/linux/mman.h -B -I "^#include <\(uapi/\)*asm/mman.h>"