public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Alexey Dobriyan <adobriyan@gmail.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	john.stultz@linaro.org,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: + kernelh-make-abs-work-with-64-bit-types.patch added to -mm tree
Date: Thu, 24 Sep 2015 15:32:55 +0200	[thread overview]
Message-ID: <xa1tsi64gcxk.fsf@mina86.com> (raw)
In-Reply-To: <CACVxJT_0KRtZyhsUh9P6SisQ2qwDtWki0xQW-RsGzHnobq0R4Q@mail.gmail.com>

On Wed, Sep 23 2015, Alexey Dobriyan wrote:
> I've sent kabs() before which didn't go in because it didn't work for
> INT_MAX et al
> (don't worry, this abs() doens't as well) but it is nicer that this
> version in other aspects
> (hopefully).
>
> [PATCH v2] Add kabs()
> http://marc.info/?l=linux-kernel&m=133518745522740&w=4

Perhaps:

+	(void)(_x)))))));						\

instead of:

+	_x))))));							\

at the end.  Since kabs makes no sense for unsigned types it’s best to
fail with compile-time error than to let user think that the call is
actually doing something.

Also, you don’t need ({ … }) around the ‘_x < 0 ? -_x : _x’ expression,
do you?

-- 
Best regards,                                            _     _
.o. | Liege of Serenely Enlightened Majesty of         o' \,=./ `o
..o | Computer Science,  ミハウ “mina86” ナザレヴイツ  (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>-----ooO--(_)--Ooo--

  parent reply	other threads:[~2015-09-24 13:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55fb3266.yHuY6+DaYTJdIL75%akpm@linux-foundation.org>
2015-09-23 13:44 ` + kernelh-make-abs-work-with-64-bit-types.patch added to -mm tree Alexey Dobriyan
2015-09-23 20:04   ` Andrew Morton
2015-09-24 13:32   ` Michal Nazarewicz [this message]
2015-09-24 14:26     ` Alexey Dobriyan
2015-09-24 18:03   ` Linus Torvalds
2015-09-25 16:36     ` Michal Nazarewicz

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=xa1tsi64gcxk.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --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