major.h: remove the remaining unnecessary includes of linux/major.h

Now that very file that needs the definitions in major.h explicitly
includes it, this is just cleaning up.

This is fairly safe because major.h does not include any other files.
The only real risk is if a symbol defined in major.h is constructed by
concatenation in the preprocessor.

The actual change was done using the following command:

  sed -i -E '/[<"](uapi\/)?linux\/major\.h/d' \
    $(grep -L -w -f xx \
      $(git grep -E -l '[<"](uapi/)?linux/major\.h'))

Where the file xx contians all the symbols defined in major.h

(genhd.h was added by inspection.)

The win here is really just the number of lines to be parsed by the
preprocessor.  major.h is 180 lines long and was being included by
these files unnecessarily.  In particular, there are 3 global include
files here (tty.h, genhd.h and blkdev.h) that are also included by 354,
68 and 554 other files, repectively.

After this, major.h is only included by 4 global include files (which
are in turn included by 297 other files), so its indirect inclusion is
hopefully much reduced.

Signed-off-by: Stephen Rothwell <>
23 files changed