public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: mingo@redhat.com, lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] IA64: cast has a higher precedence than '?'
Date: Fri, 20 Feb 2009 13:37:03 +0100	[thread overview]
Message-ID: <20090220123703.GB26418@elte.hu> (raw)
In-Reply-To: <499E9C71.3050003@gmail.com>


* Roel Kluin <roel.kluin@gmail.com> wrote:

> because of the ?: this is not strictly necessary, but I think the added
> parentheses are nice here.
> 
> --------------------------->8-------------8<------------------------------
> A cast has a higher precedence than '?'

> @@ -61,7 +61,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
>  					    struct pt_regs *regs,
>  					    int error, long val)
>  {
> -	regs->ax = (long) error ?: val;
> +	regs->ax = (long) (error ?: val);

it doesnt matter, does it? the 32-bit entity here is 'error', so 
casting it to 64-bit long is just as fine as casting the end 
result to long. In fact this should be the best:

	regs->ax = error ?: val;

as the 32-bit 'error' will be extended to 64 bits anyway.

	Ingo

  reply	other threads:[~2009-02-20 12:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 12:05 [PATCH] IA64: cast has a higher precedence than '?' Roel Kluin
2009-02-20 12:37 ` Ingo Molnar [this message]
2009-02-20 12:37 ` Ingo Molnar

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=20090220123703.GB26418@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=roel.kluin@gmail.com \
    /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