Re: [PATCH v9 09/27] gunyah: rsc_mgr: Add resource manager RPC core

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

 



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



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux