From: Christoph Hellwig <hch@infradead.org>
To: Osamu Tomita <tomita@cinet.co.jp>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCHSET] PC-9800 subarch. support for 2.5.60 (3/34) AC#3
Date: Wed, 12 Feb 2003 14:43:07 +0000 [thread overview]
Message-ID: <20030212144307.A8563@infradead.org> (raw)
In-Reply-To: <20030212132549.GD1551@yuzuki.cinet.co.jp>; from tomita@cinet.co.jp on Wed, Feb 12, 2003 at 10:25:49PM +0900
On Wed, Feb 12, 2003 at 10:25:49PM +0900, Osamu Tomita wrote:
> +ifneq ($(CONFIG_PC9800),y)
> obj-$(CONFIG_BLK_DEV_FD) += floppy.o
> +else
> +obj-$(CONFIG_BLK_DEV_FD) += floppy98.o
> +endif
Please use a different config option for your floppy driver, i.e.
CONFIG_BLK_DEV_FD98
> +#if !defined(CONFIG_PC9800) && !defined(CONFIG_PC98)
> +#error This driver works only for NEC PC-9800 series
> +#endif
this shoiuld be handled by the config system..
> +
> +#if LINUX_VERSION_CODE < 0x20200
> +# define LP_STATS
> +#endif
> +
> +#if LINUX_VERSION_CODE >= 0x2030b
> +# define CONFIG_RESOURCE98
> +#endif
it would be nice if you could get rid of those obsolete version ifdefs for a
new port..
> + /* Following `TAG: INITIALIZER' notations are GNU CC extension. */
> + flags: LP_EXIST | LP_ABORTOPEN,
> + chars: LP_INIT_CHAR,
> + time: LP_INIT_TIME,
> + wait: LP_INIT_WAIT,
> +};
please use C99-style initializers here.
> +static inline void nanodelay(unsigned long nanosecs) /* Evil ? */
yes.
> +static long long lp_old98_llseek(struct file * file,
> + long long offset, int whence)
> +{
> + return -ESPIPE; /* cannot seek like pipe */
> +}
use no_llseek instead.
> + unsigned long eflags;
> +
> + save_flags(eflags);
> + cli(); /* interrupts while check is fairly bad */
use proper spinlocking.
> +
> + if (!lp_old98_char(DC1)) {
> + restore_flags(eflags);
> + return -EBUSY;
you don't free an buffer allocated above here
> +static int lp_old98_release(struct inode * inode, struct file * file)
> +{
> + kfree(lp.lp_buffer);
> + lp.lp_buffer = NULL;
> + lp.flags &= ~LP_BUSY;
> +#ifdef CONFIG_PC9800_OLDLP_CONSOLE
> + lp_old98_console.flags = saved_console_flags;
> +#endif
> + MOD_DEC_USE_COUNT;
please use fops.owner based refcounting instead.
> +/*
> + * Many use of `put_user' macro enlarge code size...
> + */
> +static /* not inline */ int lp_old98_put_user(int val, int *addr)
> +{
> + return put_user(val, addr);
> +}
umm..
> +#ifdef MODULE
> +#define lp_old98_init init_module
> +#endif
> +
> +int __init lp_old98_init(void)
use module_init/module_exit instead.
> + if (check_region(LP_PORT_DATA, 1) || check_region(LP_PORT_STATUS, 1)
> + || check_region(LP_PORT_STROBE, 1)
> +#ifdef PC98_HW_H98
> + || ((pc98_hw_flags & PC98_HW_H98)
> + && check_region(LP_PORT_H98MODE, 1))
> +#endif
> + || check_region(LP_PORT_EXTMODE, 1)) {
> + printk(KERN_ERR
> + "lp_old98: I/O ports already occupied, giving up.\n");
> + return -EBUSY;
> + }
check_region is obsolete, use the return value from request_region instead.
> +static long long rtc_llseek(struct file *file, loff_t offset, int origin)
> +{
> + return -ESPIPE;
> +}
again, use no_llseek
> +EXPORT_NO_SYMBOLS;
EXPORT_NO_SYMBOLS is obsolete, don't use it in 2.5.
next prev parent reply other threads:[~2003-02-12 14:33 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-12 13:17 [PATCHSET] PC-9800 subarch. support for 2.5.60 (0/34) summary Osamu Tomita
2003-02-12 13:22 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (1/34) AC#1 Osamu Tomita
2003-02-12 13:24 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (2/34) AC#2 Osamu Tomita
2003-02-12 13:25 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (3/34) AC#3 Osamu Tomita
2003-02-12 14:43 ` Christoph Hellwig [this message]
2003-02-12 13:26 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (4/34) AC#4 Osamu Tomita
2003-02-12 13:28 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (5/34) AC#5 Osamu Tomita
2003-02-12 13:30 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (6/34) AC#6 Osamu Tomita
2003-02-12 13:31 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (7/34) kconfig Osamu Tomita
2003-02-12 13:34 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (8/34) ALSA Osamu Tomita
2003-02-12 13:35 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (9/34) APM Osamu Tomita
2003-02-12 13:39 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (10/34) arch/i386 Osamu Tomita
2003-02-12 13:41 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (11/34) boot98-update Osamu Tomita
2003-02-12 13:42 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (12/34) console Osamu Tomita
2003-02-12 15:36 ` Christoph Hellwig
2003-02-12 17:37 ` James Simmons
2003-02-14 23:35 ` Osamu Tomita
2003-02-12 13:45 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (13/34) NIC Osamu Tomita
2003-02-12 15:38 ` Christoph Hellwig
2003-02-12 13:46 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (14/34) floppy98-update Osamu Tomita
2003-02-12 13:47 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (15/34) FS Osamu Tomita
2003-02-12 13:49 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (16/34) video-update Osamu Tomita
2003-02-12 13:53 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (17/34) i8259-update Osamu Tomita
2003-02-12 13:54 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (18/34) IDE Osamu Tomita
2003-02-12 13:55 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (19/34) include/asm Osamu Tomita
2003-02-12 13:56 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (20/34) input-update Osamu Tomita
2003-02-12 14:05 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (21/34) input Osamu Tomita
2003-02-12 14:07 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (22/34) kernel Osamu Tomita
2003-02-12 14:08 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (23/34) lp-update Osamu Tomita
2003-02-12 14:09 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (24/34) mach-update Osamu Tomita
2003-02-12 14:10 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (25/34) parport Osamu Tomita
2003-02-12 14:11 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (26/34) pci-update Osamu Tomita
2003-02-12 14:12 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (27/34) PCI Osamu Tomita
2003-02-12 14:12 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (28/34) PCMCIA Osamu Tomita
2003-02-12 14:13 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (29/34) PNP Osamu Tomita
2003-02-12 14:14 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (30/34) SCSI Osamu Tomita
2003-02-12 15:46 ` Christoph Hellwig
2003-02-12 14:16 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (31/34) serial-update Osamu Tomita
2003-02-12 14:17 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (32/34) serial Osamu Tomita
2003-02-12 14:18 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (33/34) SMP Osamu Tomita
2003-02-12 14:18 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (34/34) rtc-update Osamu Tomita
2003-02-12 15:40 ` [PATCHSET] PC-9800 subarch. support for 2.5.60 (0/34) summary Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2003-02-14 2:05 [PATCHSET] PC-9800 subarch. support for 2.5.60 (3/34) AC#3 Osamu Tomita
2003-02-14 5:47 ` 'Christoph Hellwig '
2003-02-14 6:48 Osamu Tomita
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=20030212144307.A8563@infradead.org \
--to=hch@infradead.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=tomita@cinet.co.jp \
/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