)]}'
{
  "commit": "26d665bef44fa15f7551ee1efc19a1df331d6bbc",
  "tree": "cfbefd6023a2be430758a95a584cf3ad7fc02b12",
  "parents": [
    "fd1ef9b669e969cd57261a7f0e94823f42e10cda"
  ],
  "author": {
    "name": "Jani Nikula",
    "email": "jani.nikula@intel.com",
    "time": "Tue Sep 15 13:43:31 2026 +0300"
  },
  "committer": {
    "name": "Nathan Chancellor",
    "email": "nathan@kernel.org",
    "time": "Fri Oct 02 22:21:40 2026 +0200"
  },
  "message": "kbuild: add header check facility as a manually run static analyzer\n\nThere have been various attempts at adding a header test or check\nmechanism in the kernel build system. The header check primarily\nconsists of ensuring headers are self-contained, have include guards,\nand, in some cases, pass kernel-doc.\n\nThe main problems have been:\n\n- The dependency tracking creates undesirable artefacts (infamously also\n  known as disgusting turds) in the build directory.\n\n- Gating the feature behind a kconfig option is complicated due to\n  allyesconfig builds. It\u0027s possible, but requires a verbose and\n  confusing negative proxy config option.\n\n- Naming the dependency tracking files with a dot prefix or placing them\n  in a dot prefixed subdirectory in the build directory to hide them has\n  been exceedingly difficult to achieve. (In part due to some Makefiles\n  building files in subdirectory hierarchies.)\n\n- The debate which headers, if any, should really be self-contained is\n  virtually open-ended.\n\nApproach the problem from a slightly different angle. Add a top level\n\"headercheck\" static analysis target which you have to explicitly run,\nand where you have to explicitly state which headers to check:\n\n$ make HEADER_CHECK\u003d\"(headers|dirs)\" headercheck\n\nFor example:\n\n$ make HEADER_CHECK\u003d\"include/drm drivers/gpu/drm/drm_draw_internal.h\" headercheck\n\nYou can specify multiple path/to/header.h or path/to/dir, relative to\n$(srctree), where path/to/dir is recursively scanned for any .h files.\n\nAdd a generic %.header-check rule in scripts/Makefile.build to support\nthis. Note that this rule should *not* be used in, say, driver or\nsubsystem makefile targets, precisely because of the problems listed\nabove.\n\nWhile this still generates the .header-check dependency tracking\nartefacts in the build directory, you will only get them as a result of\nmanually running \u0027make headercheck\u0027, not as part of the regular build.\n\nThis approach also allows anyone to check any headers in the tree, with\nno makefile modification or kconfig changes required. What you do with\nthe results is up to you, and the header check facility does not enforce\nanything like it would as part of the regular build.\n\nCc: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\nCc: Nathan Chancellor \u003cnathan@kernel.org\u003e\nCc: Nicolas Schier \u003cnsc@kernel.org\u003e\nCc: Jason Gunthorpe \u003cjgg@nvidia.com\u003e\nCc: Masahiro Yamada \u003cmasahiroy@kernel.org\u003e\nCc: linux-kbuild@vger.kernel.org\nSigned-off-by: Jani Nikula \u003cjani.nikula@intel.com\u003e\nTested-by: Randy Dunlap \u003crdunlap@infradead.org\u003e\nAcked-by: Randy Dunlap \u003crdunlap@infradead.org\u003e\nLink: https://patch.msgid.link/20260915104331.255636-1-jani.nikula@intel.com\nSigned-off-by: Nathan Chancellor \u003cnathan@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9875120ea7bde02d4ac6b7ebd19d2177eb07d1e3",
      "old_mode": 33188,
      "old_path": ".gitignore",
      "new_id": "948c760b2704567bad44524d5b1f5897fe3071c5",
      "new_mode": 33188,
      "new_path": ".gitignore"
    },
    {
      "type": "modify",
      "old_id": "c496d16391035e36a1285af1be1e5c520dbc5086",
      "old_mode": 33188,
      "old_path": "Makefile",
      "new_id": "28502178746fd4b12f552940eaf9f8fc54aaecac",
      "new_mode": 33188,
      "new_path": "Makefile"
    },
    {
      "type": "modify",
      "old_id": "4349108e75e1f7c389680717b210d76d0a16eaf0",
      "old_mode": 33188,
      "old_path": "scripts/Makefile.build",
      "new_id": "6127feb970c65069b2b4e1c653daec659e7d6ccd",
      "new_mode": 33188,
      "new_path": "scripts/Makefile.build"
    }
  ]
}
