On 09.08.2023 20:41, Shawn Anastasio wrote:
> On 8/8/23 4:12 AM, Jan Beulich wrote:
>> On 03.08.2023 01:03, Shawn Anastasio wrote:
>>> @@ -15,4 +16,10 @@
>>>
>>> #define BUG_FN_REG r0
>>>
>>> +#define BUG() do { \
>>> + die(); \
>>> +} while (0)
>>
>> This looks like it's temporary. I think any construct that later needs
>> updating wants marking in some common way (such that it's easy to grep
>> for items left to be dealt with; you have such a comment in e.g.
>> asm/event.h). Of course if an entire header consists of _only_ stubs,
>> perhaps a single such comment would suffice.
>
> Yes, agreed that this macro deserves a TODO comment.
>
> As for the rest of the stub functions that this patch implements, are
> you suggesting that each file with stubs should contain a similar
> comment?
Well, each one needs to be (and remain) easily identifiable.
> Another alternative that I thought of would be to define a
> BUG_UNIMPLEMENTED() macro or similar and call that inside of all the
> stub functions.
I like this. Or maybe BUG_ON("unimplemented") could also be an option; not
sure though if the compiler wouldn't complain about the resulting
if ( unlikely("unimplemented") ).
Jan