]> www.infradead.org Git - users/hch/misc.git/commitdiff
staging: octeon: Use 'u64' instead of 'uint64_t' in union cvmx_pip_wqe_word2
authorLen Bao <len.bao@gmx.us>
Sun, 27 Jul 2025 10:10:47 +0000 (10:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Aug 2025 05:21:21 +0000 (07:21 +0200)
In the kernel type 'u64' is preferred over type 'uint64_t'. So, refactor
the 'union cvmx_pip_wqe_word2' to use the former. At the same time, take
advantage of this to align the bits quantity to improve readability.
Also, separate the structs with blank lines to gain readability.

Signed-off-by: Len Bao <len.bao@gmx.us>
Link: https://lore.kernel.org/r/20250727101052.41181-1-len.bao@gmx.us
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/octeon/octeon-stubs.h

index 44cced319c111236f5820f7154efb7f7129c2154..35b5078ba51e95da4f87e82f83d9746ae30cecb4 100644 (file)
 #define CVMX_POW_WQ_INT_PC             0
 
 union cvmx_pip_wqe_word2 {
-       uint64_t u64;
+       u64 u64;
+
        struct {
-               uint64_t bufs:8;
-               uint64_t ip_offset:8;
-               uint64_t vlan_valid:1;
-               uint64_t vlan_stacked:1;
-               uint64_t unassigned:1;
-               uint64_t vlan_cfi:1;
-               uint64_t vlan_id:12;
-               uint64_t pr:4;
-               uint64_t unassigned2:8;
-               uint64_t dec_ipcomp:1;
-               uint64_t tcp_or_udp:1;
-               uint64_t dec_ipsec:1;
-               uint64_t is_v6:1;
-               uint64_t software:1;
-               uint64_t L4_error:1;
-               uint64_t is_frag:1;
-               uint64_t IP_exc:1;
-               uint64_t is_bcast:1;
-               uint64_t is_mcast:1;
-               uint64_t not_IP:1;
-               uint64_t rcv_error:1;
-               uint64_t err_code:8;
+               u64 bufs         : 8;
+               u64 ip_offset    : 8;
+               u64 vlan_valid   : 1;
+               u64 vlan_stacked : 1;
+               u64 unassigned   : 1;
+               u64 vlan_cfi     : 1;
+               u64 vlan_id      : 12;
+               u64 pr           : 4;
+               u64 unassigned2  : 8;
+               u64 dec_ipcomp   : 1;
+               u64 tcp_or_udp   : 1;
+               u64 dec_ipsec    : 1;
+               u64 is_v6        : 1;
+               u64 software     : 1;
+               u64 L4_error     : 1;
+               u64 is_frag      : 1;
+               u64 IP_exc       : 1;
+               u64 is_bcast     : 1;
+               u64 is_mcast     : 1;
+               u64 not_IP       : 1;
+               u64 rcv_error    : 1;
+               u64 err_code     : 8;
        } s;
+
        struct {
-               uint64_t bufs:8;
-               uint64_t ip_offset:8;
-               uint64_t vlan_valid:1;
-               uint64_t vlan_stacked:1;
-               uint64_t unassigned:1;
-               uint64_t vlan_cfi:1;
-               uint64_t vlan_id:12;
-               uint64_t port:12;
-               uint64_t dec_ipcomp:1;
-               uint64_t tcp_or_udp:1;
-               uint64_t dec_ipsec:1;
-               uint64_t is_v6:1;
-               uint64_t software:1;
-               uint64_t L4_error:1;
-               uint64_t is_frag:1;
-               uint64_t IP_exc:1;
-               uint64_t is_bcast:1;
-               uint64_t is_mcast:1;
-               uint64_t not_IP:1;
-               uint64_t rcv_error:1;
-               uint64_t err_code:8;
+               u64 bufs         : 8;
+               u64 ip_offset    : 8;
+               u64 vlan_valid   : 1;
+               u64 vlan_stacked : 1;
+               u64 unassigned   : 1;
+               u64 vlan_cfi     : 1;
+               u64 vlan_id      : 12;
+               u64 port         : 12;
+               u64 dec_ipcomp   : 1;
+               u64 tcp_or_udp   : 1;
+               u64 dec_ipsec    : 1;
+               u64 is_v6        : 1;
+               u64 software     : 1;
+               u64 L4_error     : 1;
+               u64 is_frag      : 1;
+               u64 IP_exc       : 1;
+               u64 is_bcast     : 1;
+               u64 is_mcast     : 1;
+               u64 not_IP       : 1;
+               u64 rcv_error    : 1;
+               u64 err_code     : 8;
        } s_cn68xx;
 
        struct {
-               uint64_t unused1:16;
-               uint64_t vlan:16;
-               uint64_t unused2:32;
+               u64 unused1 : 16;
+               u64 vlan    : 16;
+               u64 unused2 : 32;
        } svlan;
+
        struct {
-               uint64_t bufs:8;
-               uint64_t unused:8;
-               uint64_t vlan_valid:1;
-               uint64_t vlan_stacked:1;
-               uint64_t unassigned:1;
-               uint64_t vlan_cfi:1;
-               uint64_t vlan_id:12;
-               uint64_t pr:4;
-               uint64_t unassigned2:12;
-               uint64_t software:1;
-               uint64_t unassigned3:1;
-               uint64_t is_rarp:1;
-               uint64_t is_arp:1;
-               uint64_t is_bcast:1;
-               uint64_t is_mcast:1;
-               uint64_t not_IP:1;
-               uint64_t rcv_error:1;
-               uint64_t err_code:8;
+               u64 bufs         : 8;
+               u64 unused       : 8;
+               u64 vlan_valid   : 1;
+               u64 vlan_stacked : 1;
+               u64 unassigned   : 1;
+               u64 vlan_cfi     : 1;
+               u64 vlan_id      : 12;
+               u64 pr           : 4;
+               u64 unassigned2  : 12;
+               u64 software     : 1;
+               u64 unassigned3  : 1;
+               u64 is_rarp      : 1;
+               u64 is_arp       : 1;
+               u64 is_bcast     : 1;
+               u64 is_mcast     : 1;
+               u64 not_IP       : 1;
+               u64 rcv_error    : 1;
+               u64 err_code     : 8;
        } snoip;
-
 };
 
 union cvmx_pip_wqe_word0 {