On 01.09.2023 00:22, Shawn Anastasio wrote:
> On 8/30/23 5:49 AM, Jan Beulich wrote:
>> On 23.08.2023 22:07, Shawn Anastasio wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/ppc/include/asm/div64.h
>>> @@ -0,0 +1,14 @@
>>> +#ifndef __ASM_PPC_DIV64_H__
>>> +#define __ASM_PPC_DIV64_H__
>>> +
>>> +#include <xen/types.h>
>>> +
>>> +#define do_div(n,base) ({                       \
>>> +    uint32_t __base = (base);                   \
>>> +    uint32_t __rem;                             \
>>> +    __rem = ((uint64_t)(n)) % __base;           \
>>> +    (n) = ((uint64_t)(n)) / __base;             \
>>> +    __rem;                                      \
>>> +})
>>
>> I understand you're merely copying this from elsewhere, but it would be
>> really nice if style could be corrected for such new instances (no
>> leading underscores, blank after comma, and ideally also no excess
>> parentheses).
>>
> 
> I'll fix the leading underscores and missing blank. As for unnecessary
> parenthesis, I'm assuming you mean (base) in the first statement and (n)
> in the second-to-last one, but I'd personally rather leave them.

Quite the other way around, actually:

#define do_div(n, base) ({                       \
    uint32_t base_ = (base);                     \
    uint32_t rem_ = (uint64_t)(n) % base_;       \
    (n) = (uint64_t)(n) / base_;                 \
    rem_;                                        \
})

(with other tidying included right away).

>> I also notice that most new files don't have an SPDX header. Would be
>> nice to fulfill this formal aspect right from the start.
> 
> Since you've commented on some copyright headers in trivial stub files
> before, could you clarify whether you'd want an SPDX header in every
> introduced header, including empty/trivially stubbed ones?

SPDX headers are about license, not copyright. Aiui ideally every source
file would have one.

Jan

Reply via email to