[PATCH v9 09/27] gunyah: rsc_mgr: Add resource manager RPC core
Alex Elder
elder at linaro.org
Mon Feb 6 06:14:07 PST 2023
On 2/2/23 5:53 AM, Srinivas Kandagatla wrote:
>>
>> +struct gh_rm_rpc_hdr {
>> + u8 api;
>> + u8 type;
>> + __le16 seq;
>> + __le32 msg_id;
>> +} __packed;
>> +
> #define GH_RM_RPC_HDR_SZ sizeof(struct gh_rm_rpc_hdr)
>
> You could use this in most of the places where sizeof is being called.
I'll repeat my point here. I see no value in hiding
the size of the structure behind a defined symbol.
Use sizeof(*pointer) (if possible) or sizeof(struct foo) in
the code; it makes it very clear that it's not something
other than a simple object/structure size.
-Alex
More information about the linux-arm-kernel
mailing list