From: Nick Desaulniers <nick.desaulniers@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
linux-mm@kvack.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] zsmalloc: use U suffix for negative literals being shifted
Date: Sat, 23 Dec 2017 22:28:37 -0500 [thread overview]
Message-ID: <CAH7mPvgqLf5x5QvdP1u1hpJCD+p2vy3aj=nt0RsHQH+aKTdovA@mail.gmail.com> (raw)
In-Reply-To: <20171224032437.GB5273@bombadil.infradead.org>
On Sat, Dec 23, 2017 at 10:24 PM, Matthew Wilcox <willy@infradead.org> wrote:
> On Sat, Dec 23, 2017 at 09:33:40PM -0500, Nick Desaulniers wrote:
>> Fixes warnings about shifting unsigned literals being undefined
>> behavior.
>
> Do you mean signed literals?
A sorry, s/unsigned/negative signed/g. The warning is:
mm/zsmalloc.c:1059:20: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
link->next = -1 << OBJ_TAG_BITS;
~~ ^
>
>> */
>> - link->next = -1 << OBJ_TAG_BITS;
>> + link->next = -1U << OBJ_TAG_BITS;
>> }
>
> I don't understand what -1U means. Seems like a contradiction in terms,
> a negative unsigned number. Is this supposed to be ~0U?
$ ag \\-1U[^L]
The code base is full of that literal. I think of it as:
(unsigned) -1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-12-24 3:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-24 2:33 Nick Desaulniers
2017-12-24 3:24 ` Matthew Wilcox
2017-12-24 3:28 ` Nick Desaulniers [this message]
2018-01-06 20:40 ` Nick Desaulniers
2018-01-07 15:04 ` Minchan Kim
2018-01-07 23:02 ` Andy Shevchenko
2018-01-09 4:35 ` Nick Desaulniers
2018-01-10 5:53 ` Minchan Kim
2018-01-11 3:41 ` [PATCH v2] " Nick Desaulniers
2018-01-11 7:06 ` Sergey Senozhatsky
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='CAH7mPvgqLf5x5QvdP1u1hpJCD+p2vy3aj=nt0RsHQH+aKTdovA@mail.gmail.com' \
--to=nick.desaulniers@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=willy@infradead.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