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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 12 Nov 2012 10:05:09 +0800
From:	Shan Wei <shanwei88@...il.com>
To:	Christoph Lameter <cl@...ux.com>
CC:	rostedt@...dmis.org, fweisbec@...il.com,
	Kernel-Maillist <linux-kernel@...r.kernel.org>, mingo@...hat.com
Subject: Re: [PATCH v3 7/9] trace: use this_cpu_ptr per-cpu helper

Christoph Lameter said, at 2012/11/10 4:15:
> On Fri, 9 Nov 2012, Shan Wei wrote:
> 
>> -	return buffer->buffer;
>> +	return (char *)this_cpu_ptr(&percpu_buffer->buffer);
>>  }
> 
> Add a comment to explain the cast?

typeof(&buffer) is a pointer to array of 1024 char, or char (*)[1024].
But, typeof(&buffer[0]) is a pointer to char which match the return type of get_trace_buf().
As well-known, the value of &buffer is equal to &buffer[0].
so return this_cpu_ptr(&percpu_buffer->buffer[0]) can avoid this cast. 

I will submit v4 version patch which improve it.

Thanks~
--
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