qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH qom-cpu for-1.4 04/14] target-arm: Detect attemp


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH qom-cpu for-1.4 04/14] target-arm: Detect attempt to instantiate non-CPU type in cpu_init()
Date: Wed, 23 Jan 2013 15:43:39 +0000

On 23 January 2013 15:25, Andreas Färber <address@hidden> wrote:
> Am 23.01.2013 14:41, schrieb Peter Maydell:
>> On 23 January 2013 13:38, Andreas Färber <address@hidden> wrote:
>>> Am 23.01.2013 14:03, schrieb Peter Maydell:
>>>> On 23 January 2013 12:07, Andreas Färber <address@hidden> wrote:
>>>>> +    if (cpu_model == NULL) {
>>>>> +        return NULL;
>>>>> +    }
>>>>
>>>> explicit "== NULL" is kind of ugly; established style in
>>>> target-arm/ is "if (!cpu_model)..."
>>>
>>> I consistently use !foo only if foo is bool. Any decent compiler will
>>> optimize this appropriately.
>>
>> Yes -- I prefer (!ptr) not because I think the code will be different
>> but because I think it is better style (and consistent with the
>> current code -- there are no instances of "== NULL" in target-arm
>> today).
>
> Please see style-changed version here:
> https://github.com/afaerber/qemu-cpu/commits/qom-cpu-types
> https://github.com/afaerber/qemu-cpu/commit/726554290fa69425d0e94e2e4fd2fdfeeb54e00c

Thanks.
Acked-by: Peter Maydell <address@hidden>
for the arm related patches in this series.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]