linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joey Pabalinas <joeypabalinas@gmail.com>
To: Luciano Coelho <luciano.coelho@intel.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	Joey Pabalinas <joeypabalinas@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: New sparse warning from min_t(): expression using sizeof(void)
Date: Sun, 22 Apr 2018 21:41:50 -1000	[thread overview]
Message-ID: <20180423074150.cc4nrr4ogfql43fx@gmail.com> (raw)
In-Reply-To: <4777fb12da0a71e030cc7b0cf47d5391be2a3efd.camel@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]

On Mon, Apr 23, 2018 at 09:20:14AM +0300, Luciano Coelho wrote:
> Thanks, this solves the problem for me, but I'm still getting a lot of
> this:
> 
> ./include/linux/mm.h:533:24: warning: constant 0xffffc90000000000 is so big it is unsigned long
> 
> Is there a patch in sparse to solve this one as well? Or is this an
> actual error that must be fixed in mm.h?

This is definitely a valid warning in the general case (integer promotion
rules can cause *incredibly* difficult to find bugs if you overlook them,
so it's very useful to get a warning when a promotion occurs implicitly to
integer constants).

In this case though, you are comparing it against `unsigned long addr`
which is exactly the same type, so there's no bug.

It could possibly be argued that in:

> arch/x86/include/asm/pgtable_64_types.h:122: # define VMALLOC_START __VMALLOC_BASE_L4
> arch/x86/include/asm/pgtable_64_types.h:108: #define __VMALLOC_BASE_L4 0xffffc90000000000

__VMALLOC_BASE_L4 would be better written as 0xffffc90000000000UL, which would
indeed shut up sparse.

-- 
Cheers,
Joey Pabalinas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-04-23  7:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-21  7:50 New sparse warning from min_t(): expression using sizeof(void) Kalle Valo
2018-04-21  8:24 ` Joey Pabalinas
2018-04-21  8:54   ` Kalle Valo
2018-04-23  6:20     ` Luciano Coelho
2018-04-23  7:41       ` Joey Pabalinas [this message]
2018-04-23 14:10     ` Kalle Valo

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=20180423074150.cc4nrr4ogfql43fx@gmail.com \
    --to=joeypabalinas@gmail.com \
    --cc=keescook@chromium.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).