lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090220123703.GB26418@elte.hu>
Date:	Fri, 20 Feb 2009 13:37:03 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Roel Kluin <roel.kluin@...il.com>
Cc:	mingo@...hat.com, lkml <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] IA64: cast has a higher precedence than '?'


* Roel Kluin <roel.kluin@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ