From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: Andrew Victor <linux@maxim.org.za>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Haavard Skinnemoen <haavard.skinnemoen@atmel.com>,
linux-ide@vger.kernel.org
Subject: Re: [RFC][PATCH] at91_ide driver
Date: Fri, 16 Jan 2009 18:43:19 +0100 [thread overview]
Message-ID: <200901161843.19487.bzolnier@gmail.com> (raw)
In-Reply-To: <200901141345.42583.stf_xl@wp.pl>
Czesc,
Just some minor nitpicks:
On Wednesday 14 January 2009, Stanislaw Gruszka wrote:
[...]
> +static const struct ide_tp_ops at91_ide_tp_ops = {
> + .exec_command = ide_exec_command,
> + .read_status = ide_read_status,
> + .read_altstatus = ide_read_altstatus,
> + .set_irq = ide_set_irq,
> +
> + .tf_load = at91_ide_tf_load,
> + .tf_read = at91_ide_tf_read,
> +
> + .input_data = at91_ide_input_data,
> + .output_data = at91_ide_output_data,
> +};
no strong feelings about CodingStyle but we usually do:
...
.exec_command = ide_exec_command,
.read_status = ide_read_status,
...
which helps code readability and consistency
> +static void at91_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
> +{
> + u8 chipselect = drive->hwif->extra_base;
> +
> + pdbg("pio %u\n", pio);
> +
> + if (pio > 6) {
> + perr("can't set PIO %d mode\n", pio);
> + return;
> + }
no need for this check (core code guarantees that it won't happen)
> +static const struct ide_port_info at91_ide_port_info __initdata = {
> + .port_ops = &at91_ide_port_ops,
> + .tp_ops = &at91_ide_tp_ops,
> + .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA | IDE_HFLAG_SINGLE,
> + .pio_mask = ATA_PIO6,
> +};
AFAICS IDE_HFLAG_NO_IO_32BIT should also be set here,
you may also want to set IDE_HFLAG_UNMASK_IRQS while at it
and CodingStyle fixup would be a nice bonus
> +#if 0
> + /* In 12-0275-01 version of the PCB address
> + * lines CF_A0 and CF_A2 are swapped */
> + hw.io_ports.data_addr = tf_base + 0;
> + hw.io_ports.error_addr = tf_base + 4;
> + hw.io_ports.nsect_addr = tf_base + 2;
> + hw.io_ports.lbal_addr = tf_base + 6;
> + hw.io_ports.lbam_addr = tf_base + 1;
> + hw.io_ports.lbah_addr = tf_base + 5;
> + hw.io_ports.device_addr = tf_base + 3;
> + hw.io_ports.command_addr = tf_base + 7;
> +#else
> + /* Proper lines addresses */
> + hw.io_ports.data_addr = tf_base + 0;
> + hw.io_ports.error_addr = tf_base + 1;
> + hw.io_ports.nsect_addr = tf_base + 2;
> + hw.io_ports.lbal_addr = tf_base + 3;
> + hw.io_ports.lbam_addr = tf_base + 4;
> + hw.io_ports.lbah_addr = tf_base + 5;
> + hw.io_ports.device_addr = tf_base + 6;
> + hw.io_ports.command_addr = tf_base + 7;
> +#endif
How's about using enums for offsets, i.e.
enum {
#if 0
...
AT91_IDE_ERROR_ADDR_OFFSET = 4,
...
#else
...
AT91_IDE_ERROR_ADDR_OFFSET = 1,
...
#endif
};
?
otherwise (except issues already discussed in the other mail) it looks fine
next prev parent reply other threads:[~2009-01-16 17:43 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-14 12:45 [RFC][PATCH] at91_ide driver Stanislaw Gruszka
2009-01-14 12:58 ` Haavard Skinnemoen
2009-01-14 13:21 ` Stanislaw Gruszka
2009-01-14 17:05 ` Sergei Shtylyov
2009-01-22 11:19 ` Stanislaw Gruszka
2009-01-14 13:17 ` Alan Cox
2009-01-14 14:35 ` Stanislaw Gruszka
2009-01-14 15:14 ` Alan Cox
2009-01-16 13:32 ` Sergei Shtylyov
2009-01-16 15:03 ` Stanislaw Gruszka
2009-01-16 15:34 ` Sergei Shtylyov
2009-01-16 16:13 ` Alan Cox
2009-01-17 20:08 ` Sergei Shtylyov
2009-01-17 20:20 ` Alan Cox
2009-01-18 10:58 ` Sergei Shtylyov
2009-01-18 15:29 ` Sergei Shtylyov
2009-01-19 11:51 ` Stanislaw Gruszka
2009-01-19 15:20 ` Sergei Shtylyov
2009-01-16 16:58 ` Bartlomiej Zolnierkiewicz
2009-01-17 16:45 ` Sergei Shtylyov
2009-01-19 22:50 ` Sergei Shtylyov
2009-01-27 15:31 ` Bartlomiej Zolnierkiewicz
2009-01-19 11:14 ` Stanislaw Gruszka
2009-01-19 12:52 ` Bartlomiej Zolnierkiewicz
2009-01-16 17:43 ` Bartlomiej Zolnierkiewicz [this message]
2009-01-19 11:20 ` Stanislaw Gruszka
2009-01-30 9:05 ` Stanislaw Gruszka
2009-02-01 17:13 ` Bartlomiej Zolnierkiewicz
2009-02-02 12:35 ` Stanislaw Gruszka
2009-01-20 11:07 ` Sergei Shtylyov
2009-01-20 14:49 ` Stanislaw Gruszka
2009-01-20 15:33 ` Sergei Shtylyov
2009-01-21 10:33 ` Stanislaw Gruszka
2009-01-22 9:44 ` Sergei Shtylyov
2009-01-22 10:15 ` Stanislaw Gruszka
2009-01-22 11:12 ` Stanislaw Gruszka
2009-01-22 12:06 ` Sergei Shtylyov
2009-01-22 12:16 ` Sergei Shtylyov
2009-01-22 12:24 ` Sergei Shtylyov
2009-01-22 12:57 ` Stanislaw Gruszka
2009-01-22 13:38 ` Sergei Shtylyov
2009-01-22 13:14 ` Stanislaw Gruszka
2009-01-22 13:48 ` Sergei Shtylyov
2009-01-22 14:13 ` Stanislaw Gruszka
2009-01-27 15:46 ` Sergei Shtylyov
2009-01-29 14:48 ` Stanislaw Gruszka
2009-01-29 15:22 ` Sergei Shtylyov
2009-01-22 14:39 ` Stanislaw Gruszka
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=200901161843.19487.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=haavard.skinnemoen@atmel.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=nicolas.ferre@atmel.com \
--cc=stf_xl@wp.pl \
/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.