All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
Cc: "Marek Behún" <kabel@kernel.org>,
	libc-alpha@sourceware.org,
	"G. Branden Robinson" <g.branden.robinson@gmail.com>,
	"Michael Kerrisk" <mtk.manpages@gmail.com>,
	linux-man@vger.kernel.org
Subject: Re: [PATCH v4] ioctl_tty.2: Add example how to get or set baudrate on the serial port
Date: Fri, 10 Sep 2021 15:39:47 +0200	[thread overview]
Message-ID: <20210910133947.hr7nmpqmmwnmqp2f@pali> (raw)
In-Reply-To: <56938369-cd99-d768-55da-5eac4cd268d4@gmail.com>

On Friday 10 September 2021 15:37:54 Alejandro Colomar (man-pages) wrote:
> Hi, Pali!
> 
> On 8/31/21 10:34 PM, Pali Rohár wrote:
> > On Tuesday 10 August 2021 21:49:28 Pali Rohár wrote:
> > > Setting custom baudrate for which is not defined Bnnn constant is possible
> > > via BOTHER flag and then filling speed in c_ospeed and c_ispeed fields.
> > > 
> > > These two fields are either in struct termios or struct termios2. Former
> > > belongs to TCGETS/TCSETS ioctls, latter to TCGETS2/TCSETS2 ioctls.
> > > 
> > > BOTHER flag with these two fields and new struct termios2 is not supported
> > > by older versions of include header files.
> > > 
> > > Some architectures (e.g. amd64) provide both struct termios and struct
> > > termios2, but c_ospeed and c_ispeed are only in struct termios2.
> > > 
> > > Some other architectures (e.g. alpha) provide both struct termios and struct
> > > termios2 and both have c_ospeed and c_ispeed fields.
> > > 
> > > And some other architectures (e.g. powerpc) provide only struct termios
> > > (no struct termios2) and it has c_ospeed and c_ispeed fields.
> > > 
> > > So basically to support all architectures it is needed to use
> > > struct termios2 when TCGETS2/TCSETS2 is supported. Otherwise it is needed
> > > to use struct termios with TCGETS/TCSETS (case for e.g. powerpc).
> > > 
> > > Setting input baudrate is done via IBSHIFT macro.
> > > 
> > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > 
> > Hello! Do you have any comments on this patch?
> 
> Sorry, I started to fix the licensing issues Greg pointed out, and forgot
> about this.
> 
> I assume it's good since you have been doing a lot of related work in recent
> patches.  I'll only point out a cosmetic issue with the preprocessor stuff:
> I'd indent with a single space after '#' to clarify preprocessor #if #else
> #endif relationships and improve readability.  I also prefer '#if
> [!]defined()' rather than '#if[n]def' (except for include guards); and there
> seems to be a mix in the existing pages, so I'll standardize that way from
> now on.
> 
> For example:
> 
> #if !defined a
> #else
> # if defined b
> # endif
> #endif
> 
> However, I applied those changes myself in a following patch, so you don't
> worry about them.

Ok, perfect, thanks!

> Patch applied!
> 
> Thanks,
> 
> Alex

      reply	other threads:[~2021-09-10 13:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30  9:53 [PATCH] ioctl_tty.2: Add example how to get or set baudrate on the serial port Pali Rohár
2021-07-30 11:47 ` Alejandro Colomar (man-pages)
2021-07-30 12:05   ` Pali Rohár
2021-07-30 12:21     ` Alejandro Colomar (man-pages)
2021-07-30 13:02 ` [PATCH v2] " Pali Rohár
2021-08-01 13:51 ` [PATCH v3] " Pali Rohár
2021-08-04 22:08   ` Pali Rohár
2021-08-05  5:52     ` Greg Kroah-Hartman
2021-08-05  8:22       ` Pali Rohár
2021-08-05  8:30         ` Greg Kroah-Hartman
2021-08-05  8:44           ` Pali Rohár
2021-08-05  8:50             ` Greg Kroah-Hartman
2021-08-05  9:51               ` Pali Rohár
2021-08-05 15:28                 ` Alejandro Colomar (man-pages)
2021-08-05 16:14                   ` Greg Kroah-Hartman
2021-08-05 16:45                     ` Licensing example programs in man-pages (was [PATCH v3] ioctl_tty.2: Add example how to get or set baudrate on the serial port) Alejandro Colomar (man-pages)
2021-08-05 17:54                       ` Greg Kroah-Hartman
2021-08-06  7:22                         ` Alejandro Colomar (man-pages)
2021-08-06  8:32                           ` Pali Rohár
2021-08-08  8:35   ` [PATCH v3] ioctl_tty.2: Add example how to get or set baudrate on the serial port Alejandro Colomar (man-pages)
2021-08-08 21:05     ` Pali Rohár
2021-08-08 21:19       ` Alejandro Colomar (man-pages)
2021-08-10 19:49 ` [PATCH v4] " Pali Rohár
2021-08-10 20:11   ` Pali Rohár
2021-08-31 20:34   ` Pali Rohár
2021-09-10 13:37     ` Alejandro Colomar (man-pages)
2021-09-10 13:39       ` Pali Rohár [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=20210910133947.hr7nmpqmmwnmqp2f@pali \
    --to=pali@kernel.org \
    --cc=alx.manpages@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --cc=kabel@kernel.org \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.