public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Yoelvis Oliveros <yoelvisoliveros@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, outreachy@lists.linux.dev
Subject: Re: [PATCH] staging: octeon: type change from uint<bits>_t to u<bits>
Date: Tue, 10 Feb 2026 10:19:52 +0000	[thread overview]
Message-ID: <20260210101952.631bf50c@pumpkin> (raw)
In-Reply-To: <aYq028TNyXQWZ_v5@home-pc>

On Tue, 10 Feb 2026 00:36:31 -0400
Yoelvis Oliveros <yoelvisoliveros@gmail.com> wrote:

> Runing the ckeckpatch.pl on the staging/octeon driver they where using
> uint<8/16/32/64>_T as type declaration and the checkpatch.pl was
> putting a [CHECK] flag on those and that they should be change to
> u<8/16/32/64>
> 
...
>  	struct {
> -		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;

As a separate issue, what is the purpose of all these bit-field structures?
You can't portably use C bit-fields to map hardware registers or network
packets.
It isn't just byte-order, the 'bit order' can differ even for the same
endianness.

It also doesn't seem ideal to base everything on u64.
The (aligned) 8 bit fields should really be plain 'u8', there are places
where it does make a difference.

	David




  parent reply	other threads:[~2026-02-10 10:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  4:36 [PATCH] staging: octeon: type change from uint<bits>_t to u<bits> Yoelvis Oliveros
2026-02-10  4:58 ` Greg KH
2026-02-10  6:50 ` Dan Carpenter
2026-02-10 10:19 ` David Laight [this message]
2026-02-10 10:41   ` Dan Carpenter
2026-02-10 12:28     ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260210101952.631bf50c@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=outreachy@lists.linux.dev \
    --cc=yoelvisoliveros@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox