Re: [RFC PATCH 1/4] asm-generic/barrier: add generic nospec helpers

2018-01-05 Thread Mark Rutland
On Thu, Jan 04, 2018 at 08:21:56PM -0800, Dan Williams wrote:
> On Thu, Jan 4, 2018 at 4:00 AM, Mark Rutland  wrote:
> > On Wed, Jan 03, 2018 at 10:38:24PM +, Mark Rutland wrote:
> >> +#define nospec_array_load(arr, idx, sz)   
> >>\
> >> +({   \
> >> + typeof(*(arr)) *__arr = arr;\
> >> + typeof(idx) __idx = idx;\
> >> + typeof(sz) __sz = __sz; \
> >
> > Whoops. The second __sz should be sz here.
> 
> Those should all have parenthesis on the args too, right?

Probably, yes.

I've added those to the version in my core/nospec branch.

Thanks,
Mark.


Re: [RFC PATCH 1/4] asm-generic/barrier: add generic nospec helpers

2018-01-05 Thread Mark Rutland
On Thu, Jan 04, 2018 at 08:21:56PM -0800, Dan Williams wrote:
> On Thu, Jan 4, 2018 at 4:00 AM, Mark Rutland  wrote:
> > On Wed, Jan 03, 2018 at 10:38:24PM +, Mark Rutland wrote:
> >> +#define nospec_array_load(arr, idx, sz)   
> >>\
> >> +({   \
> >> + typeof(*(arr)) *__arr = arr;\
> >> + typeof(idx) __idx = idx;\
> >> + typeof(sz) __sz = __sz; \
> >
> > Whoops. The second __sz should be sz here.
> 
> Those should all have parenthesis on the args too, right?

Probably, yes.

I've added those to the version in my core/nospec branch.

Thanks,
Mark.


Re: [RFC PATCH 1/4] asm-generic/barrier: add generic nospec helpers

2018-01-04 Thread Dan Williams
On Thu, Jan 4, 2018 at 4:00 AM, Mark Rutland  wrote:
> On Wed, Jan 03, 2018 at 10:38:24PM +, Mark Rutland wrote:
>> +#define nospec_array_load(arr, idx, sz) 
>>  \
>> +({   \
>> + typeof(*(arr)) *__arr = arr;\
>> + typeof(idx) __idx = idx;\
>> + typeof(sz) __sz = __sz; \
>
> Whoops. The second __sz should be sz here.

Those should all have parenthesis on the args too, right?


Re: [RFC PATCH 1/4] asm-generic/barrier: add generic nospec helpers

2018-01-04 Thread Dan Williams
On Thu, Jan 4, 2018 at 4:00 AM, Mark Rutland  wrote:
> On Wed, Jan 03, 2018 at 10:38:24PM +, Mark Rutland wrote:
>> +#define nospec_array_load(arr, idx, sz) 
>>  \
>> +({   \
>> + typeof(*(arr)) *__arr = arr;\
>> + typeof(idx) __idx = idx;\
>> + typeof(sz) __sz = __sz; \
>
> Whoops. The second __sz should be sz here.

Those should all have parenthesis on the args too, right?


Re: [RFC PATCH 1/4] asm-generic/barrier: add generic nospec helpers

2018-01-04 Thread Mark Rutland
On Wed, Jan 03, 2018 at 10:38:24PM +, Mark Rutland wrote:
> +#define nospec_array_load(arr, idx, sz)  
> \
> +({   \
> + typeof(*(arr)) *__arr = arr;\
> + typeof(idx) __idx = idx;\
> + typeof(sz) __sz = __sz; \

Whoops. The second __sz should be sz here.

Mark.


Re: [RFC PATCH 1/4] asm-generic/barrier: add generic nospec helpers

2018-01-04 Thread Mark Rutland
On Wed, Jan 03, 2018 at 10:38:24PM +, Mark Rutland wrote:
> +#define nospec_array_load(arr, idx, sz)  
> \
> +({   \
> + typeof(*(arr)) *__arr = arr;\
> + typeof(idx) __idx = idx;\
> + typeof(sz) __sz = __sz; \

Whoops. The second __sz should be sz here.

Mark.