On Wed, Mar 09, 2016 at 01:59:03PM +0100, Paolo Bonzini wrote:
> If you look at users, they only write about 20 bytes at most. My
> suggestion is to use your patch, and replace
>
> assert(__BUF_SIZE >= n);
>
> with
>
> assert(n < ARRAY_SIZE(tmp));
>
> Then you don't need the #define.
On 09/03/2016 09:07, Peter Xu wrote:
>>> > > pxdev:bin# gcc -v
>>> > > Using built-in specs.
>>> > > COLLECT_GCC=/bin/gcc
>>> > > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
>>> > > Target: x86_64-redhat-linux
>>> > > Configured with: ../configure --prefix=/usr
Peter Xu writes:
> On Wed, Mar 09, 2016 at 09:34:50AM +0100, Markus Armbruster wrote:
>> Peter Xu writes:
>> > It's dynamically allocated in stack, can we still use ARRAY_SIZE in
>> > this case?
>>
>> ARRAY_SIZE(x) is defined as (sizeof(x) /
On Wed, Mar 09, 2016 at 09:34:50AM +0100, Markus Armbruster wrote:
> Peter Xu writes:
> > It's dynamically allocated in stack, can we still use ARRAY_SIZE in
> > this case?
>
> ARRAY_SIZE(x) is defined as (sizeof(x) / sizeof((x)[0])). Works when x
> is of array type (variable
Peter Xu writes:
> On Wed, Mar 09, 2016 at 08:53:19AM +0100, Paolo Bonzini wrote:
>>
>>
>> On 09/03/2016 06:08, Peter Xu wrote:
>> > pxdev:bin# gcc -v
>> > Using built-in specs.
>> > COLLECT_GCC=/bin/gcc
>> >
On Wed, Mar 09, 2016 at 08:53:19AM +0100, Paolo Bonzini wrote:
>
>
> On 09/03/2016 06:08, Peter Xu wrote:
> > pxdev:bin# gcc -v
> > Using built-in specs.
> > COLLECT_GCC=/bin/gcc
> > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
> > Target: x86_64-redhat-linux
> >
On 09/03/2016 06:08, Peter Xu wrote:
> pxdev:bin# gcc -v
> Using built-in specs.
> COLLECT_GCC=/bin/gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
>
On Tue, Mar 08, 2016 at 02:26:36PM +0700, Peter Maydell wrote:
> On 8 March 2016 at 14:00, Peter Xu wrote:
> > First of all, this function cannot be inlined even with always_inline,
> > so removing inline.
>
> Please don't mix two different changes in one patch.
Sorry. Will
On Tue, Mar 08, 2016 at 01:21:52PM +0100, Paolo Bonzini wrote:
>
>
> On 08/03/2016 08:00, Peter Xu wrote:
> > First of all, this function cannot be inlined even with always_inline,
> > so removing inline.
>
> Why? always_inline fixes the error for me.
I tried this patch:
-
On 08/03/2016 08:00, Peter Xu wrote:
> First of all, this function cannot be inlined even with always_inline,
> so removing inline.
Why? always_inline fixes the error for me.
> int i;
> -uint32_t tmp[len / sizeof(uint32_t)];
> +uint32_t n = len / sizeof(uint32_t);
> +#define
On 8 March 2016 at 14:00, Peter Xu wrote:
> First of all, this function cannot be inlined even with always_inline,
> so removing inline.
Please don't mix two different changes in one patch.
> After that, make its stack bounded.
>
> Suggested-by: Paolo Bonzini
First of all, this function cannot be inlined even with always_inline,
so removing inline.
After that, make its stack bounded.
Suggested-by: Paolo Bonzini
CC: Gerd Hoffmann
Signed-off-by: Peter Xu
---
hw/usb/hcd-xhci.c | 12
12 matches
Mail list logo