From: Yury Norov <yury.norov@gmail.com>
To: "Max Görner" <max@familie-goerner.eu>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: Bug Report: 2cc7b6 exposes violations of type limits
Date: Thu, 13 May 2021 07:47:16 -0700 [thread overview]
Message-ID: <YJ079LaADbsxWnbu@yury-ThinkPad> (raw)
In-Reply-To: <YJz5+i5Nb1iyqY5c@solactive.solactive>
[CC: LKML]
On Thu, May 13, 2021 at 12:05:46PM +0200, Max Görner wrote:
> Dear Mr Norov, dear Mr Morton,
>
> with this e-mail I want to report a bug in the kernel to you. I am approaching
> both of you because you are the author and the maintainer, respectively.
>
> I am the maintainer of a community fork of a WIFI driver (rtl88x2bu,
> https://github.com/cilynx/rtl88x2bu/tree/5.8.7.1_35809.20191129_COEX20191120-7777).
> Usually new kernel versions introduce new incompatibilities which break the
> compilation. I then add a new `#if LINUX_VERSION_CODE` branch in which I fix
> things.
>
> I am proud to say that the driver compiles with `-O3 -Wall -Werror` with only a
> modest number of `-Wno-...` directives. I usually compile with
> `-O2 -Wall -Werror`, though.
>
> In the merge window for Linux Kernel v5.13 Mr Norov added commit
> 2cc7b6a44ac21d31b398b03f4845c53152070416 which looks fairly innocent to me.
> However, it exposes some information to GCC, allowing GCC to deduce that some
> comparisons do not make sense. Now GCC complains that there are tests whether
> an `unsigned long` is `< 0`.
>
> However, these problems appear only when I try to compile the WIFI driver, not
> when compiling the kernel itself. I suspect that the problems would appear if
> the kernel would be compiled with `-Wall -Werror`, but I do not know how to do
> that. I attached the error messages in a separate file.
>
> I think having type limit violations in the code is bad in itself. It also
> breaks some external code (my driver). With this bug report I want to kindly
> ask you if you could fix these type limit violations.
>
>
> Thank you very much.
>
>
> Best regards
>
> Max Görner
> make ARCH=x86_64 CROSS_COMPILE= -C /home/mgoerner/Werkbank/Hobbys/Linux-Kernel/linux M=/home/mgoerner/Werkbank/Hobbys/rtl88x2bu modules
> make[1]: Verzeichnis „/home/mgoerner/Werkbank/Hobbys/Linux-Kernel/linux“ wird betreten
> CC [M] /home/mgoerner/Werkbank/Hobbys/rtl88x2bu/core/rtw_cmd.o
> In file included from ./include/linux/bits.h:22,
> from ./include/linux/bitops.h:6,
> from ./include/linux/kernel.h:12,
> from ./include/linux/list.h:9,
> from ./include/linux/module.h:12,
> from /home/mgoerner/Werkbank/Hobbys/rtl88x2bu/include/basic_types.h:76,
> from /home/mgoerner/Werkbank/Hobbys/rtl88x2bu/include/drv_types.h:26,
> from /home/mgoerner/Werkbank/Hobbys/rtl88x2bu/core/rtw_cmd.c:17:
> ./include/asm-generic/bitops/find.h: In function ‘find_first_bit’:
> ./include/linux/bits.h:25:28: error: comparison of unsigned expression in ‘< 0’ is always false [-Werror=type-limits]
> 25 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
> | ^
[...]
Kernel disables -Werror=type-limits in scripts/Makefile.extrawarn. It
looks missed -Wno-type-limits in your scripts.
parent reply other threads:[~2021-05-13 14:49 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <YJz5+i5Nb1iyqY5c@solactive.solactive>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YJ079LaADbsxWnbu@yury-ThinkPad \
--to=yury.norov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=max@familie-goerner.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox