All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	linux-sh <linux-sh@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast
Date: Tue, 15 Jan 2008 00:29:58 +0000	[thread overview]
Message-ID: <20080115002958.GA27597@linux-sh.org> (raw)
In-Reply-To: <1200352635.6196.8.camel@localhost.localdomain>

On Mon, Jan 14, 2008 at 11:17:15PM +0000, Adrian McMenamin wrote:
> +/* GD Rom registers */
> +#define GDROM_BASE_REG 			0xA05F7000
> +#define GDROM_ALTSTATUS_REG 		(GDROM_BASE_REG + 0x18)
> +#define GDROM_DATA_REG 			(GDROM_BASE_REG + 0x80)
> +#define GDROM_ERROR_REG 		(GDROM_BASE_REG + 0x84)
> +#define GDROM_INTSEC_REG 		(GDROM_BASE_REG + 0x88)
> +#define GDROM_SECNUM_REG 		(GDROM_BASE_REG + 0x8C)
> +#define GDROM_BCL_REG  			(GDROM_BASE_REG + 0x90)
> +#define GDROM_BCH_REG 			(GDROM_BASE_REG + 0x94)
> +#define GDROM_DSEL_REG 			(GDROM_BASE_REG + 0x98)
> +#define GDROM_STATUSCOMMAND_REG 	(GDROM_BASE_REG + 0x9C)
> +#define GDROM_RESET_REG 		(GDROM_BASE_REG + 0x4E4)
> +
> +#define GDROM_DMA_STARTADDR_REG 	(GDROM_BASE_REG + 0x404)
> +#define GDROM_DMA_LENGTH_REG 		(GDROM_BASE_REG + 0x408)
> +#define GDROM_DMA_DIRECTION_REG 	(GDROM_BASE_REG + 0x40C)
> +#define GDROM_DMA_ENABLE_REG 		(GDROM_BASE_REG + 0x414)
> +#define GDROM_DMA_STATUS_REG 		(GDROM_BASE_REG + 0x418)
> +#define GDROM_DMA_WAIT_REG 		(GDROM_BASE_REG + 0x4A0)
> +#define GDROM_DMA_ACCESS_CTRL_REG 	(GDROM_BASE_REG + 0x4B8)
> +

Almost all of these are whitespace damaged. checkpatch doesn't seem to
catch them, but that's checkpatch's problem.

If your editor has no way of flagging whitespace damage in a visible
fashion, you may wish to consider replacing it with something that isn't
crap.

With vim you can use something like 'let c_space_errors=1' to see these.

> +static bool gdrom_data_request(void)
> +{
> + 	return (ctrl_inb(GDROM_ALTSTATUS_REG) & 0x88) = 8;
> +}
> +
Andrew first pointed this out, and this is still broken. Additionally,
checkpatch _does_ complain about this:

ERROR: use tabs not spaces
#202: FILE: drivers/cdrom/gdrom.c:146:
+ ^Ireturn (ctrl_inb(GDROM_ALTSTATUS_REG) & 0x88) = 8;$

ERROR: use tabs not spaces
#230: FILE: drivers/cdrom/gdrom.c:174:
+ ^I * been hit by a serious failure - but we'll$

ERROR: use tabs not spaces
#231: FILE: drivers/cdrom/gdrom.c:175:
+ ^I * try to return a sense key even so */$

ERROR: use tabs not spaces
#497: FILE: drivers/cdrom/gdrom.c:441:
+ ^I * the sense key if possible */$

ERROR: use tabs not spaces
#517: FILE: drivers/cdrom/gdrom.c:461:
+ ^I^Iprintk(KERN_ERR "GDROM: Unknown sense key: %d\n", sense_key);$

ERROR: use tabs not spaces
#680: FILE: drivers/cdrom/gdrom.c:624:
+ ^I^I * before handling ending the request */$

ERROR: use tabs not spaces
#692: FILE: drivers/cdrom/gdrom.c:636:
+ ^I * and then schedule workqueue */$

ERROR: use tabs not spaces
#764: FILE: drivers/cdrom/gdrom.c:708:
+ ^I * Bits 31 - 16 security: 0x8843$

ERROR: use tabs not spaces
#765: FILE: drivers/cdrom/gdrom.c:709:
+ ^I * Bits 15 and 7 reserved (0)$

ERROR: use tabs not spaces
#766: FILE: drivers/cdrom/gdrom.c:710:
+ ^I * Bits 14 - 8 start of transfer range in 1 MB blocks OR'ed with 0x80$

ERROR: trailing whitespace
#767: FILE: drivers/cdrom/gdrom.c:711:
+ ^I * Bits 6 - 0 end of transfer range in 1 MB blocks OR'ed with 0x80 $

ERROR: use tabs not spaces
#767: FILE: drivers/cdrom/gdrom.c:711:
+ ^I * Bits 6 - 0 end of transfer range in 1 MB blocks OR'ed with 0x80 $

ERROR: use tabs not spaces
#768: FILE: drivers/cdrom/gdrom.c:712:
+ ^I * (0x40 | 0x80) = start range at 0x0C000000$

ERROR: use tabs not spaces
#769: FILE: drivers/cdrom/gdrom.c:713:
+ ^I * (0x7F | 0x80) = end range at 0x0FFFFFFF */$

WARNING: line over 80 characters
#873: FILE: drivers/cdrom/gdrom.c:817:
+	printk(KERN_WARNING "GDROM: Could not probe for device - error is 0x%X\n", err);

All of these seem to stem from the fact that your editor is misconfigured
or broken. Please fix all of these and resubmit.

> +static int __devinit probe_gdrom(struct platform_device *devptr)
> +{
[snip]

> +}
> +
> +static int remove_gdrom(struct platform_device *devptr)
> +{
> +	flush_scheduled_work();
> +	blk_cleanup_queue(gd.gdrom_rq);
> +	free_irq(HW_EVENT_GDROM_CMD, &gd);
> +	free_irq(HW_EVENT_GDROM_DMA, &gd);
> +	del_gendisk(gd.disk);
> +	if (gdrom_major)
> +		unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
> +	return unregister_cdrom(gd.cd_info);
> +}
> +
> +static struct platform_driver gdrom_driver = {
> +	.probe = probe_gdrom,
> +	.remove = remove_gdrom,
> +	.driver = {
> +			.name = GDROM_DEV_NAME,
> +	},
> +};
> +
Well, you're half-way there. You've got probe_gdrom() as __devinit, now
remove_gdrom() needs to be __devexit, and you can wrap around it with
__devexit_p() in the gdrom_driver definition.

WARNING: multiple messages have this Message-ID (diff)
From: Paul Mundt <lethal@linux-sh.org>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	linux-sh <linux-sh@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast
Date: Tue, 15 Jan 2008 09:29:58 +0900	[thread overview]
Message-ID: <20080115002958.GA27597@linux-sh.org> (raw)
In-Reply-To: <1200352635.6196.8.camel@localhost.localdomain>

On Mon, Jan 14, 2008 at 11:17:15PM +0000, Adrian McMenamin wrote:
> +/* GD Rom registers */
> +#define GDROM_BASE_REG 			0xA05F7000
> +#define GDROM_ALTSTATUS_REG 		(GDROM_BASE_REG + 0x18)
> +#define GDROM_DATA_REG 			(GDROM_BASE_REG + 0x80)
> +#define GDROM_ERROR_REG 		(GDROM_BASE_REG + 0x84)
> +#define GDROM_INTSEC_REG 		(GDROM_BASE_REG + 0x88)
> +#define GDROM_SECNUM_REG 		(GDROM_BASE_REG + 0x8C)
> +#define GDROM_BCL_REG  			(GDROM_BASE_REG + 0x90)
> +#define GDROM_BCH_REG 			(GDROM_BASE_REG + 0x94)
> +#define GDROM_DSEL_REG 			(GDROM_BASE_REG + 0x98)
> +#define GDROM_STATUSCOMMAND_REG 	(GDROM_BASE_REG + 0x9C)
> +#define GDROM_RESET_REG 		(GDROM_BASE_REG + 0x4E4)
> +
> +#define GDROM_DMA_STARTADDR_REG 	(GDROM_BASE_REG + 0x404)
> +#define GDROM_DMA_LENGTH_REG 		(GDROM_BASE_REG + 0x408)
> +#define GDROM_DMA_DIRECTION_REG 	(GDROM_BASE_REG + 0x40C)
> +#define GDROM_DMA_ENABLE_REG 		(GDROM_BASE_REG + 0x414)
> +#define GDROM_DMA_STATUS_REG 		(GDROM_BASE_REG + 0x418)
> +#define GDROM_DMA_WAIT_REG 		(GDROM_BASE_REG + 0x4A0)
> +#define GDROM_DMA_ACCESS_CTRL_REG 	(GDROM_BASE_REG + 0x4B8)
> +

Almost all of these are whitespace damaged. checkpatch doesn't seem to
catch them, but that's checkpatch's problem.

If your editor has no way of flagging whitespace damage in a visible
fashion, you may wish to consider replacing it with something that isn't
crap.

With vim you can use something like 'let c_space_errors=1' to see these.

> +static bool gdrom_data_request(void)
> +{
> + 	return (ctrl_inb(GDROM_ALTSTATUS_REG) & 0x88) == 8;
> +}
> +
Andrew first pointed this out, and this is still broken. Additionally,
checkpatch _does_ complain about this:

ERROR: use tabs not spaces
#202: FILE: drivers/cdrom/gdrom.c:146:
+ ^Ireturn (ctrl_inb(GDROM_ALTSTATUS_REG) & 0x88) == 8;$

ERROR: use tabs not spaces
#230: FILE: drivers/cdrom/gdrom.c:174:
+ ^I * been hit by a serious failure - but we'll$

ERROR: use tabs not spaces
#231: FILE: drivers/cdrom/gdrom.c:175:
+ ^I * try to return a sense key even so */$

ERROR: use tabs not spaces
#497: FILE: drivers/cdrom/gdrom.c:441:
+ ^I * the sense key if possible */$

ERROR: use tabs not spaces
#517: FILE: drivers/cdrom/gdrom.c:461:
+ ^I^Iprintk(KERN_ERR "GDROM: Unknown sense key: %d\n", sense_key);$

ERROR: use tabs not spaces
#680: FILE: drivers/cdrom/gdrom.c:624:
+ ^I^I * before handling ending the request */$

ERROR: use tabs not spaces
#692: FILE: drivers/cdrom/gdrom.c:636:
+ ^I * and then schedule workqueue */$

ERROR: use tabs not spaces
#764: FILE: drivers/cdrom/gdrom.c:708:
+ ^I * Bits 31 - 16 security: 0x8843$

ERROR: use tabs not spaces
#765: FILE: drivers/cdrom/gdrom.c:709:
+ ^I * Bits 15 and 7 reserved (0)$

ERROR: use tabs not spaces
#766: FILE: drivers/cdrom/gdrom.c:710:
+ ^I * Bits 14 - 8 start of transfer range in 1 MB blocks OR'ed with 0x80$

ERROR: trailing whitespace
#767: FILE: drivers/cdrom/gdrom.c:711:
+ ^I * Bits 6 - 0 end of transfer range in 1 MB blocks OR'ed with 0x80 $

ERROR: use tabs not spaces
#767: FILE: drivers/cdrom/gdrom.c:711:
+ ^I * Bits 6 - 0 end of transfer range in 1 MB blocks OR'ed with 0x80 $

ERROR: use tabs not spaces
#768: FILE: drivers/cdrom/gdrom.c:712:
+ ^I * (0x40 | 0x80) = start range at 0x0C000000$

ERROR: use tabs not spaces
#769: FILE: drivers/cdrom/gdrom.c:713:
+ ^I * (0x7F | 0x80) = end range at 0x0FFFFFFF */$

WARNING: line over 80 characters
#873: FILE: drivers/cdrom/gdrom.c:817:
+	printk(KERN_WARNING "GDROM: Could not probe for device - error is 0x%X\n", err);

All of these seem to stem from the fact that your editor is misconfigured
or broken. Please fix all of these and resubmit.

> +static int __devinit probe_gdrom(struct platform_device *devptr)
> +{
[snip]

> +}
> +
> +static int remove_gdrom(struct platform_device *devptr)
> +{
> +	flush_scheduled_work();
> +	blk_cleanup_queue(gd.gdrom_rq);
> +	free_irq(HW_EVENT_GDROM_CMD, &gd);
> +	free_irq(HW_EVENT_GDROM_DMA, &gd);
> +	del_gendisk(gd.disk);
> +	if (gdrom_major)
> +		unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
> +	return unregister_cdrom(gd.cd_info);
> +}
> +
> +static struct platform_driver gdrom_driver = {
> +	.probe = probe_gdrom,
> +	.remove = remove_gdrom,
> +	.driver = {
> +			.name = GDROM_DEV_NAME,
> +	},
> +};
> +
Well, you're half-way there. You've got probe_gdrom() as __devinit, now
remove_gdrom() needs to be __devexit, and you can wrap around it with
__devexit_p() in the gdrom_driver definition.

  reply	other threads:[~2008-01-15  0:29 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-27  1:26 [PATCH] SH/Dreamcast - add support for GD-Rom device Adrian McMenamin
2007-12-27  8:18 ` Paul Mundt
2007-12-27  8:18   ` Paul Mundt
2007-12-27 12:49   ` Adrian McMenamin
2007-12-27 19:52     ` Jens Axboe
2007-12-27 19:52       ` Jens Axboe
2007-12-27 19:11   ` Mike Frysinger
2007-12-27 19:11     ` Mike Frysinger
2007-12-27 16:52 ` Adrian McMenamin
2007-12-27 16:52   ` Adrian McMenamin
2007-12-27 20:56   ` Adrian McMenamin
2007-12-27 20:56     ` Adrian McMenamin
2007-12-27 22:20   ` Paul Mundt
2007-12-27 22:20     ` Paul Mundt
2007-12-27 22:58   ` Joe Perches
2007-12-27 22:58     ` Joe Perches
2007-12-28  0:18     ` Simon Holm Thøgersen
2007-12-28  0:18       ` Simon Holm Thøgersen
2007-12-29  1:57       ` Joe Perches
2007-12-29  1:57         ` Joe Perches
2007-12-29 12:03         ` Adrian McMenamin
2007-12-29 12:10           ` Adrian McMenamin
2007-12-29 18:07           ` Joe Perches
2007-12-29 18:07             ` Joe Perches
2007-12-28  0:49     ` Mike Frysinger
2007-12-28  0:49       ` Mike Frysinger
2007-12-28  3:41       ` Paul Mundt
2007-12-28  3:41         ` Paul Mundt
2007-12-28 19:17     ` Gino Badouri
2007-12-28 19:17       ` Gino Badouri
2007-12-28 22:09       ` Joe Perches
2007-12-28 22:09         ` Joe Perches
2007-12-30 13:38     ` Adrian McMenamin
2007-12-31  5:23       ` Paul Mundt
2007-12-31  5:23         ` Paul Mundt
2008-01-10 23:25 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Adrian McMenamin
2008-01-10 23:25   ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-11 21:56   ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-11 21:56     ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-12 11:57     ` Jens Axboe
2008-01-12 11:57       ` Jens Axboe
2008-01-12 13:36     ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Andrew Morton
2008-01-12 13:36       ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Andrew Morton
2008-01-12 14:14       ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-12 14:14         ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-12 19:15         ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Andrew Morton
2008-01-12 19:15           ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Andrew Morton
2008-01-13 18:24           ` Adrian McMenamin
2008-01-13 18:24             ` Adrian McMenamin
2008-01-14 23:00       ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-14 23:00         ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-14 23:17         ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-14 23:17           ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-15  0:29           ` Paul Mundt [this message]
2008-01-15  0:29             ` Paul Mundt
2008-01-15 20:41             ` Adrian McMenamin
2008-01-15 20:41               ` Adrian McMenamin
2008-01-16 23:57           ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-16 23:57             ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-17  1:27             ` Paul Mundt
2008-01-17  1:27               ` Paul Mundt
2008-01-17 22:30               ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-17 22:30                 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-18  0:56                 ` Paul Mundt
2008-01-18  0:56                   ` Paul Mundt
2008-01-28  5:33                   ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Andrew Morton
2008-01-28  5:33                     ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Andrew Morton
2008-01-28  5:53                     ` Paul Mundt
2008-01-28  5:53                       ` Paul Mundt
2008-01-16  1:57       ` Paul Mundt
2008-01-16  1:57         ` Paul Mundt

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=20080115002958.GA27597@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=adrian@newgolddream.dyndns.info \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@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 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.