From: Christoph Hellwig <hch@infradead.org>
To: Paul Fulghum <paulkf@microgate.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"alan@lxorguk.ukuu.org.uk" <alan@lxorguk.ukuu.org.uk>,
"torvalds@transmeta.com" <torvalds@transmeta.com>
Subject: Re: [PATCH] n_hdlc.c 2.5.68 (try 2)
Date: Mon, 21 Apr 2003 20:42:00 +0100 [thread overview]
Message-ID: <20030421204200.A12475@infradead.org> (raw)
In-Reply-To: <1050952852.1841.41.camel@diemos>; from paulkf@microgate.com on Mon, Apr 21, 2003 at 02:20:53PM -0500
On Mon, Apr 21, 2003 at 02:20:53PM -0500, Paul Fulghum wrote:
> Attempt 2 with suggestions from Chritoph Hellwig
>
> * Remove MODULE_USE_COUNT macros
> * Add owner member to struct tty_ldisc
> * Init tty_ldisc at compile time
> * make some functions static
.oO(I guess you'll have me for moaning again, but..)
>
> static int __init n_hdlc_init(void)
> {
> - static struct tty_ldisc n_hdlc_ldisc;
> + static struct tty_ldisc n_hdlc_ldisc = {
Usual Linux style is to have this outside of any function scope.
That'll get important once we get a saner tty_unregister_ldisc
prototype.
> + TTY_LDISC_MAGIC, /* magic */
> + "hdlc", /* name */
Please use C99 named initializers.
> + 0, /* num */
> + 0, /* flags */
And no need to initialize anything to 0/NULL.
It should look like:
static struct tty_ldisc n_hdlc_ldisc = {
.owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "hdlc",
.open = n_hdlc_tty_open,
.close = n_hdlc_tty_close,
.read = n_hdlc_tty_read,
.write = n_hdlc_tty_write,
.ioctl = n_hdlc_tty_ioctl,
.poll = n_hdlc_tty_poll,
.receive_buf = n_hdlc_tty_receive,
.receive_room = n_hdlc_tty_room,
.write_wakeup = n_hdlc_tty_wakeup,
};
next prev parent reply other threads:[~2003-04-21 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-21 19:20 Paul Fulghum
2003-04-21 19:42 ` Christoph Hellwig [this message]
2003-04-21 21:12 ` [PATCH] n_hdlc.c 2.5.68 (try 3) Paul Fulghum
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=20030421204200.A12475@infradead.org \
--to=hch@infradead.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=paulkf@microgate.com \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®