From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "Starke, Daniel" <daniel.starke@siemens.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"jirislaby@kernel.org" <jirislaby@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/8] tty: n_gsm: add restart parameter to DLC specific ioctl config
Date: Mon, 24 Apr 2023 18:41:00 +0200 [thread overview]
Message-ID: <2023042453-dubbed-botany-2ed9@gregkh> (raw)
In-Reply-To: <bdb4347-d0e9-96c5-031-ecc549a7d1cd@linux.intel.com>
On Mon, Apr 24, 2023 at 04:20:00PM +0300, Ilpo Järvinen wrote:
> On Mon, 24 Apr 2023, Greg KH wrote:
>
> > On Mon, Apr 24, 2023 at 11:03:26AM +0000, Starke, Daniel wrote:
> > > > > --- a/include/uapi/linux/gsmmux.h
> > > > > +++ b/include/uapi/linux/gsmmux.h
> > > > > @@ -58,7 +58,8 @@ struct gsm_dlci_config {
> > > > > __u32 priority; /* Priority (0 for default value) */
> > > > > __u32 i; /* Frame type (1 = UIH, 2 = UI) */
> > > > > __u32 k; /* Window size (0 for default value) */
> > > > > - __u32 reserved[8]; /* For future use, must be initialized to zero */
> > > > > + __u32 restart; /* Force DLCI channel reset? */
> > > >
> > > > Why are you using a full 32 bits for just 1 bit of data here? Why not
> > > > use a bitfield?
> > >
> > > The ioctrl guide states:
> > > Bitfields and enums generally work as one would expect them to,
> > > but some properties of them are implementation-defined, so it is better
> > > to avoid them completely in ioctl interfaces.
> > >
> > > Therefore, I tried to avoid them here.
> >
> > Then use a u8?
>
> To add further, I think that the ioctl guidance tries to say that C
> bitfields using :number postfix are not a good idea, not that much to
> disallow flag like content within an integer type.
Agreed.
prev parent reply other threads:[~2023-04-24 16:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 7:52 [PATCH v3 1/8] tty: n_gsm: add restart parameter to DLC specific ioctl config D. Starke
2023-04-24 7:52 ` [PATCH v3 2/8] tty: n_gsm: add missing description to gsm_config D. Starke
2023-04-24 7:52 ` [PATCH v3 3/8] tty: n_gsm: remove unneeded initialization of ret in gsm_dlci_config D. Starke
2023-04-24 7:52 ` [PATCH v3 4/8] tty: n_gsm: add open_error counter to gsm_mux D. Starke
2023-04-24 7:52 ` [PATCH v3 5/8] tty: n_gsm: increase malformed counter for malformed control frames D. Starke
2023-04-24 7:52 ` [PATCH v3 6/8] tty: n_gsm: increase gsm_mux unsupported counted where appropriate D. Starke
2023-04-24 7:52 ` [PATCH v3 7/8] tty: n_gsm: cleanup gsm_control_command and gsm_control_reply D. Starke
2023-04-24 7:52 ` [PATCH v3 8/8] tty: n_gsm: add DLCI specific rx/tx statistics D. Starke
2023-04-24 10:54 ` [PATCH v3 1/8] tty: n_gsm: add restart parameter to DLC specific ioctl config Greg KH
2023-04-24 11:03 ` Starke, Daniel
2023-04-24 12:54 ` Greg KH
2023-04-24 13:20 ` Ilpo Järvinen
2023-04-24 16:41 ` Greg Kroah-Hartman [this message]
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=2023042453-dubbed-botany-2ed9@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=daniel.starke@siemens.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).