Commit Graph

1764 Commits

Author SHA1 Message Date
Linus Torvalds 9ba07a72fc gcc-10: disable 'array-bounds' warning for now
commit 44720996e2d79e47d508b0abe99b931a726a3197 upstream.

This is another fine warning, related to the 'zero-length-bounds' one,
but hitting the same historical code in the kernel.

Because C didn't historically support flexible array members, we have
code that instead uses a one-sized array, the same way we have cases of
zero-sized arrays.

The one-sized arrays come from either not wanting to use the gcc
zero-sized array extension, or from a slight convenience-feature, where
particularly for strings, the size of the structure now includes the
allocation for the final NUL character.

So with a "char name[1];" at the end of a structure, you can do things
like

       v = my_malloc(sizeof(struct vendor) + strlen(name));

and avoid the "+1" for the terminator.

Yes, the modern way to do that is with a flexible array, and using
'offsetof()' instead of 'sizeof()', and adding the "+1" by hand.  That
also technically gets the size "more correct" in that it avoids any
alignment (and thus padding) issues, but this is another long-term
cleanup thing that will not happen for 5.7.

So disable the warning for now, even though it's potentially quite
useful.  Having a slew of warnings that then hide more urgent new issues
is not an improvement.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:20:28 +02:00
Linus Torvalds a740b68fd1 gcc-10: disable 'zero-length-bounds' warning for now
commit 5c45de21a2223fe46cf9488c99a7fbcf01527670 upstream.

This is a fine warning, but we still have a number of zero-length arrays
in the kernel that come from the traditional gcc extension.  Yes, they
are getting converted to flexible arrays, but in the meantime the gcc-10
warning about zero-length bounds is very verbose, and is hiding other
issues.

I missed one actual build failure because it was hidden among hundreds
of lines of warning.  Thankfully I caught it on the second go before
pushing things out, but it convinced me that I really need to disable
the new warnings for now.

We'll hopefully be all done with our conversion to flexible arrays in
the not too distant future, and we can then re-enable this warning.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:20:28 +02:00
Linus Torvalds 8f6a84167e Stop the ad-hoc games with -Wno-maybe-initialized
commit 78a5255ffb6a1af189a83e493d916ba1c54d8c75 upstream.

We have some rather random rules about when we accept the
"maybe-initialized" warnings, and when we don't.

For example, we consider it unreliable for gcc versions < 4.9, but also
if -O3 is enabled, or if optimizing for size.  And then various kernel
config options disabled it, because they know that they trigger that
warning by confusing gcc sufficiently (ie PROFILE_ALL_BRANCHES).

And now gcc-10 seems to be introducing a lot of those warnings too, so
it falls under the same heading as 4.9 did.

At the same time, we have a very straightforward way to _enable_ that
warning when wanted: use "W=2" to enable more warnings.

So stop playing these ad-hoc games, and just disable that warning by
default, with the known and straight-forward "if you want to work on the
extra compiler warnings, use W=123".

Would it be great to have code that is always so obvious that it never
confuses the compiler whether a variable is used initialized or not?
Yes, it would.  In a perfect world, the compilers would be smarter, and
our source code would be simpler.

That's currently not the world we live in, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:20:28 +02:00
Greg Kroah-Hartman cbaf236995 Linux 5.4.41 2020-05-14 07:58:30 +02:00
Greg Kroah-Hartman f015b86259 Linux 5.4.40 2020-05-10 10:31:34 +02:00
Greg Kroah-Hartman 592465e6a5 Linux 5.4.39 2020-05-06 08:15:17 +02:00
Greg Kroah-Hartman 9895e0ac33 Linux 5.4.38 2020-05-02 17:26:50 +02:00
Greg Kroah-Hartman 527c60e8b7 Linux 5.4.37 2020-05-02 08:49:02 +02:00
Greg Kroah-Hartman aa73bcc376 Linux 5.4.36 2020-04-29 16:33:25 +02:00
Greg Kroah-Hartman 0c418786cb Linux 5.4.35 2020-04-23 10:36:46 +02:00
Greg Kroah-Hartman 6ccc74c083 Linux 5.4.34 2020-04-21 09:05:05 +02:00
Greg Kroah-Hartman dc4059d21d Linux 5.4.33 2020-04-17 10:50:26 +02:00
Greg Kroah-Hartman bc844d58f6 Linux 5.4.32 2020-04-13 10:48:18 +02:00
Greg Kroah-Hartman de850633a0 Linux 5.4.31 2020-04-08 09:08:47 +02:00
Greg Kroah-Hartman ad13e142e0 Linux 5.4.30 2020-04-02 15:11:03 +02:00
Greg Kroah-Hartman 73fea3292b Linux 5.4.29 2020-04-01 11:02:18 +02:00
Greg Kroah-Hartman 462afcd6e7 Linux 5.4.28 2020-03-25 08:26:00 +01:00
Greg Kroah-Hartman 585e0cc080 Linux 5.4.27 2020-03-21 08:12:00 +01:00
Masahiro Yamada df8e98b009 kbuild: add dt_binding_check to PHONY in a correct place
[ Upstream commit c473a8d03ea8e03ca9d649b0b6d72fbcf6212c05 ]

The dt_binding_check is added to PHONY, but it is invisible when
$(dtstree) is empty. So, it is not specified as phony for
ARCH=x86 etc.

Add it to PHONY outside the ifneq ... endif block.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-03-21 08:11:52 +01:00
Masahiro Yamada fd1f29f2a8 kbuild: add dtbs_check to PHONY
[ Upstream commit 964a596db8db8c77c9903dd05655696696e6b3ad ]

The dtbs_check should be a phony target, but currently it is not
specified so.

'make dtbs_check' works even if a file named 'dtbs_check' exists
because it depends on another phony target, scripts_dtc, but we
should not rely on it.

Add dtbs_check to PHONY.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-03-21 08:11:52 +01:00
Greg Kroah-Hartman 257edc6db9 Linux 5.4.26 2020-03-18 07:17:59 +01:00
Greg Kroah-Hartman 18fe53f6df Linux 5.4.25 2020-03-12 13:00:32 +01:00
Greg Kroah-Hartman cff670b3eb Linux 5.4.24 2020-03-05 16:43:52 +01:00
Masahiro Yamada c15a3d8f5e kbuild: make single target builds even faster
commit b1fbfcb4a20949df08dd995927cdc5ad220c128d upstream.

Commit 2dffd23f81a3 ("kbuild: make single target builds much faster")
made the situation much better.

To improve it even more, apply the similar idea to the top Makefile.
Trim unrelated directories from build-dirs.

The single build code must be moved above the 'descend' target.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-05 16:43:48 +01:00
Masahiro Yamada 2e54f93a3b kbuild: remove unneeded variable, single-all
commit 35e046a203ee3bc8ba9ae3561b50de02646dfb81 upstream.

When single-build is set, everything in $(MAKECMDGOALS) is a single
target. You can use $(MAKECMDGOALS) to list out the single targets.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-05 16:43:47 +01:00
Masahiro Yamada ecd77a3261 kbuild: move headers_check rule to usr/include/Makefile
commit 7ecaf069da52e472d393f03e79d721aabd724166 upstream.

Currently, some sanity checks for uapi headers are done by
scripts/headers_check.pl, which is wired up to the 'headers_check'
target in the top Makefile.

It is true compiling headers has better test coverage, but there
are still several headers excluded from the compile test. I like
to keep headers_check.pl for a while, but we can delete a lot of
code by moving the build rule to usr/include/Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-05 16:43:47 +01:00
Masahiro Yamada ef134d8b49 kbuild: remove header compile test
commit fcbb8461fd2376ba3782b5b8bd440c929b8e4980 upstream.

There are both positive and negative options about this feature.
At first, I thought it was a good idea, but actually Linus stated a
negative opinion (https://lkml.org/lkml/2019/9/29/227). I admit it
is ugly and annoying.

The baseline I'd like to keep is the compile-test of uapi headers.
(Otherwise, kernel developers have no way to ensure the correctness
of the exported headers.)

I will maintain a small build rule in usr/include/Makefile.
Remove the other header test functionality.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[ added to 5.4.y due to start of build warnings from backported patches
  because of this feature - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-05 16:43:47 +01:00
Greg Kroah-Hartman bfe3046eca Linux 5.4.23 2020-02-28 17:22:29 +01:00
Greg Kroah-Hartman f22dcb3172 Linux 5.4.22 2020-02-24 08:37:04 +01:00
Greg Kroah-Hartman 2d636a1263 Linux 5.4.21 2020-02-19 19:53:10 +01:00
Greg Kroah-Hartman 27dfbcc2f5 Linux 5.4.20 2020-02-14 16:34:20 -05:00
Greg Kroah-Hartman d6591ea2dd Linux 5.4.19 2020-02-11 04:35:55 -08:00
Greg Kroah-Hartman 58c72057f6 Linux 5.4.18 2020-02-05 21:22:53 +00:00
Greg Kroah-Hartman 313c8460cf Linux 5.4.17 2020-02-01 09:34:53 +00:00
Greg Kroah-Hartman 60b6aa2b71 Linux 5.4.16 2020-01-29 16:45:34 +01:00
Greg Kroah-Hartman 111e415c94 Linux 5.4.15 2020-01-26 10:01:09 +01:00
Greg Kroah-Hartman 0fce94b45b Linux 5.4.14 2020-01-23 08:23:01 +01:00
Greg Kroah-Hartman ba19874032 Linux 5.4.13 2020-01-17 19:49:08 +01:00
Greg Kroah-Hartman adc0acf587 Linux 5.4.12 2020-01-14 20:08:40 +01:00
Greg Kroah-Hartman 9d61432efb Linux 5.4.11 2020-01-12 12:21:53 +01:00
Greg Kroah-Hartman 7a02c19329 Linux 5.4.10 2020-01-09 10:25:53 +01:00
Greg Kroah-Hartman 5063556304 Linux 5.4.9 2020-01-09 10:20:08 +01:00
Greg Kroah-Hartman 5825c88e96 Linux 5.4.8 2020-01-04 19:19:19 +01:00
Greg Kroah-Hartman 122179cb7d Linux 5.4.7 2019-12-31 16:46:36 +01:00
Greg Kroah-Hartman 957a16c3e6 Linux 5.4.6 2019-12-21 11:05:23 +01:00
Greg Kroah-Hartman 9a08897100 Linux 5.4.5 2019-12-18 16:09:17 +01:00
Greg Kroah-Hartman dc71226e59 Linux 5.4.4 2019-12-17 19:56:55 +01:00
Greg Kroah-Hartman f7688b48ac Linux 5.4.3 2019-12-13 08:43:32 +01:00
Greg Kroah-Hartman 5f8bc2bb0e Linux 5.4.2 2019-12-04 22:31:09 +01:00
Greg Kroah-Hartman 79438f37a6 Linux 5.4.1 2019-11-29 10:10:32 +01:00