From: Konrad Zapalowicz <bergo.torino@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: jslaby@suse.cz, cascardo@linux.vnet.ibm.com, markh@compro.net,
devel@driverdev.osuosl.org, lidza.louina@gmail.com,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH 2/5] drivers: serial: jsm: Add the Classic board implementation
Date: Fri, 7 Nov 2014 00:11:46 +0100 [thread overview]
Message-ID: <20141106231146.GB29761@t400> (raw)
In-Reply-To: <20141106191808.GA32427@kroah.com>
On 11/06, Greg KH wrote:
> On Mon, Nov 03, 2014 at 07:52:38PM +0100, Konrad Zapalowicz wrote:
> > This commit adds the Digi Classic board implementation to the
> > staging/jsm driver.
> >
> > The code here is taken from the staging/dgnc driver and modified to
> > match the serial/jsm state. This work is mostly based on the changes
> > that has been done to the code handling the Digi Neo cards with the
> > inspiration coming from the diff between staging/dgnc and serial/jsm
> > as well as the LKML history for the jsm_neo.c
> >
> > The code compiles now and has no sparse and checkpatch errors or
> > warnings.
>
> The compiler does give me one warning for this file:
>
> > +/*
> > + * cls_param()
> > + * Send any/all changes to the line to the UART.
> > + */
> > +static void cls_param(struct jsm_channel *ch)
> > +{
> > + u8 lcr = 0;
> > + u8 uart_lcr = 0;
> > + u8 ier = 0;
> > + u32 baud = 9600;
> > + int quot = 0;
> > + struct jsm_board *bd;
> > + int i;
> > + unsigned int cflag;
> > +
> > + bd = ch->ch_bd;
> > + if (!bd)
> > + return;
> > +
> > + /*
> > + * If baud rate is zero, flush queues, and set mval to drop DTR.
> > + */
> > + if ((ch->ch_c_cflag & (CBAUD)) == 0) {
> > + ch->ch_r_head = 0;
> > + ch->ch_r_tail = 0;
> > + ch->ch_e_head = 0;
> > + ch->ch_e_tail = 0;
> > +
> > + cls_flush_uart_write(ch);
> > + cls_flush_uart_read(ch);
> > +
> > + /* The baudrate is B0 so all modem lines are to be dropped. */
> > + ch->ch_flags |= (CH_BAUD0);
> > + ch->ch_mostat &= ~(UART_MCR_RTS | UART_MCR_DTR);
> > + cls_assert_modem_signals(ch);
> > + return;
> > + }
> > +
> > + static struct {
> > + unsigned int rate;
> > + unsigned int cflag;
> > + } baud_rates[] = {
> > + { 921600, B921600 },
> > + { 460800, B460800 },
> > + { 230400, B230400 },
> > + { 115200, B115200 },
> > + { 57600, B57600 },
> > + { 38400, B38400 },
> > + { 19200, B19200 },
> > + { 9600, B9600 },
> > + { 4800, B4800 },
> > + { 2400, B2400 },
> > + { 1200, B1200 },
> > + { 600, B600 },
> > + { 300, B300 },
> > + { 200, B200 },
> > + { 150, B150 },
> > + { 134, B134 },
> > + { 110, B110 },
> > + { 75, B75 },
> > + { 50, B50 },
> > + };
>
> baud_rates needs to be up above the code, as gcc tells me:
>
> drivers/tty/serial/jsm/jsm_cls.c: In function ‘cls_param’:
> drivers/tty/serial/jsm/jsm_cls.c:701:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
> static struct {
> ^
>
> Can you fix that up and resend the series? I've taken the first patch in this
> series, as that is an easy one to accept, so no need to resend that one.
Fixed and delivered. You may notice that the jsm_neo.c code is using
the same structure to store the baud rates. If feels natural to change
it there too however since the subject of this series is the support for
Classic boards I decided not to refactor this now. I'll do it properly later
plus I will fix some other things that I have spotted so far in this
code.
cheers,
konrad
> thanks,
>
> greg k-h
prev parent reply other threads:[~2014-11-06 23:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 0:06 [PATCH 0/5] serial: jsm: Add support for the Digi Classic adapters Konrad Zapalowicz
2014-11-03 0:06 ` [PATCH 1/5] drivers: serial: jsm: Add Classic board UART structure Konrad Zapalowicz
2014-11-03 0:06 ` [PATCH 2/5] drivers: serial: jsm: Add the Classic board implementation Konrad Zapalowicz
2014-11-03 0:06 ` [PATCH 3/5] drivers: serial: jsm: Enable support for Digi Classic adapters Konrad Zapalowicz
2014-11-03 0:06 ` [PATCH 4/5] staging: dgnc: Remove driver in favor of serial/jsm driver Konrad Zapalowicz
2014-11-03 0:06 ` [PATCH 5/5] drivers: serial: jsm: Remove FSF address from the file documentation/header Konrad Zapalowicz
2014-11-03 9:38 ` [PATCH 0/5] serial: jsm: Add support for the Digi Classic adapters Dan Carpenter
2014-11-03 18:52 ` [PATCH 1/5] drivers: serial: jsm: Add Classic board UART structure Konrad Zapalowicz
2014-11-03 18:52 ` [PATCH 2/5] drivers: serial: jsm: Add the Classic board implementation Konrad Zapalowicz
2014-11-03 18:52 ` [PATCH 3/5] drivers: serial: jsm: Enable support for Digi Classic adapters Konrad Zapalowicz
2014-11-03 18:52 ` [PATCH 4/5] staging: dgnc: Remove driver in favor of serial/jsm driver Konrad Zapalowicz
2014-11-06 19:18 ` [PATCH 2/5] drivers: serial: jsm: Add the Classic board implementation Greg KH
2014-11-06 23:05 ` [PATCH v2 0/4] serial: jsm: Add support for the Digi Classic adapters Konrad Zapalowicz
2014-11-06 23:05 ` [PATCH v2 1/4] drivers: serial: jsm: Add the Classic board implementation Konrad Zapalowicz
2014-11-06 23:05 ` [PATCH v2 2/4] drivers: serial: jsm: Enable support for Digi Classic adapters Konrad Zapalowicz
2014-11-06 23:05 ` [PATCH v2 3/4] staging: dgnc: Remove driver in favor of serial/jsm driver Konrad Zapalowicz
2014-11-06 23:05 ` [PATCH v2 4/4] drivers: serial: jsm: Remove FSF address from the file documentation/header Konrad Zapalowicz
2014-11-06 23:20 ` [PATCH v2 3/4] staging: dgnc: Remove driver in favor of serial/jsm driver Greg KH
2014-11-06 23:36 ` Konrad Zapalowicz
2014-11-07 16:12 ` Greg KH
2014-11-06 23:11 ` Konrad Zapalowicz [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=20141106231146.GB29761@t400 \
--to=bergo.torino@gmail.com \
--cc=cascardo@linux.vnet.ibm.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=lidza.louina@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=markh@compro.net \
/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