From: Damien Le Moal <dlemoal@kernel.org>
To: Daniel Palmer <daniel@0x0f.com>
Cc: ysato@users.sourceforge.jp, dalias@libc.org,
glaubitz@physik.fu-berlin.de, cassel@kernel.org,
linux-sh@vger.kernel.org, linux-ide@vger.kernel.org,
geert@linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
Date: Thu, 22 Oct 2026 11:33:12 +0200 [thread overview]
Message-ID: <db1f6641-9700-43b3-b091-e736c8ef88f5@kernel.org> (raw)
In-Reply-To: <CAFr9PXnNKfZtXpBe2OVZvu=rf+fsx5NEp7tSGS_FxRKsL3+wQw@mail.gmail.com>
On 2026/10/22 11:17, Daniel Palmer wrote:
> Hi Damien,
>
> On Thu, 22 Oct 2026 at 16:01, Damien Le Moal <dlemoal@kernel.org> wrote:
>>> + case 2: { /* 6280 or 6280 + fast */
>>> + void __iomem *bmdma = pci_iomap(pdev, 4, 1);
>>> + u8 cfg;
>>> +
>>> + if (!bmdma)
>>> + return -ENOMEM;
>>> + cfg = ioread8(bmdma);
>>> + pci_iounmap(pdev, bmdma);
>>> + if (cfg & 0x10)
>>> ppi[0] = &info_628x_fast;
>>> else
>>> ppi[0] = &info_628x;
>>> break;
>>> }
>>> + }
>>
>> This is really ugly... Please move the "case 2" variable declarations to the top
>> of the function so that you do not have to do something like this.
>
> That's fair. I'll fix that up.
>
>> Of note also is that this switch does not have a "default" case, which is really
>> bad practice, even though in this case, we should never hit unknown values.
>> But I would still prefer seeing something like:
>>
>> default:
>> pr_warn("Invalid driver data\n");
>> pci_disable_device(pdev);
>> return -ENODEV;
>> }
>
> Can we fix that later or should I roll it into this patch? Being an
> old driver I think it probably has a bunch of preexisting style issues
> that need to be fixed but that seems like a separate issue from making
> it functional again.
Later is fine.
>
> Cheers,
>
> Daniel
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-10-22 9:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 4:14 [PATCH 0/2] sh: Fix IDE on landisk Daniel Palmer
2026-10-17 4:14 ` [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap Daniel Palmer
2026-10-19 13:08 ` Florian Fuchs
2026-10-21 18:11 ` John Paul Adrian Glaubitz
2026-10-22 7:01 ` Damien Le Moal
2026-10-22 9:17 ` Daniel Palmer
2026-10-22 9:33 ` Damien Le Moal [this message]
2026-10-17 4:14 ` [PATCH 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865 Daniel Palmer
2026-10-18 19:01 ` Florian Fuchs
2026-10-17 7:48 ` [PATCH 0/2] sh: Fix IDE on landisk John Paul Adrian Glaubitz
2026-10-18 14:48 ` Geert Uytterhoeven
2026-10-18 23:04 ` Daniel Palmer
2026-10-19 14:07 ` yoshinori.sato
2026-10-21 8:52 ` John Paul Adrian Glaubitz
2026-10-21 1:05 ` Colton Pawielski
2026-10-21 9:01 ` Geert Uytterhoeven
2026-10-21 10:55 ` Daniel Palmer
2026-10-21 23:22 ` Colton Pawielski
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=db1f6641-9700-43b3-b091-e736c8ef88f5@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=dalias@libc.org \
--cc=daniel@0x0f.com \
--cc=geert@linux-m68k.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=ysato@users.sourceforge.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
all inboxes | Powered by JetHome®