All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Molton <spyro@f2s.com>
To: linux-kernel@vger.kernel.org
Subject: IDE 2.5.69 possible bogosity...
Date: Thu, 22 May 2003 23:24:48 +0100	[thread overview]
Message-ID: <20030522232448.21d7ee2f.spyro@f2s.com> (raw)

Hi.

Im wondering if this is correct. is the test for initializing in the
second for loop correct?

Im building an IDE driver into my kernel that calls ide_register_hw()
twice to register its primary and secondary ports, but only the
secondary port is recognised. the first fails, since the test in the
first for loop fails and so does the second, so it then 'unregisters'
it, despite never having been registered. somehow, this puts my drive
INTO the hwif array, so the secondary interface registers OK, passing
the other tests.

a hack that allowed the primary interface to register was to register it
twice, but that sucks.

int ide_register_hw (hw_regs_t *hw, ide_hwif_t **hwifp)
{
        int index, retry = 1;
        ide_hwif_t *hwif;

        do {
                for (index = 0; index < MAX_HWIFS; ++index) {
                        hwif = &ide_hwifs[index];
                        if (hwif->hw.io_ports[IDE_DATA_OFFSET] ==
hw->io_ports[IDE_DATA_OFFSET])
                                goto found;
                }
                for (index = 0; index < MAX_HWIFS; ++index) {
                        hwif = &ide_hwifs[index];

*** is the test for initialising (not the !initialising one) here ok?
***

                    if ((!hwif->present && !hwif->mate && !initializing)
||
                        (!hwif->hw.io_ports[IDE_DATA_OFFSET] &&
initializing))
                                goto found;
                }
                for (index = 0; index < MAX_HWIFS; index++)
                        ide_unregister(index);
        } while (retry--);

             reply	other threads:[~2003-05-22 22:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-22 22:24 Ian Molton [this message]
2003-05-22 22:52 ` IDE 2.5.69 possible bogosity Bartlomiej Zolnierkiewicz

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=20030522232448.21d7ee2f.spyro@f2s.com \
    --to=spyro@f2s.com \
    --cc=linux-kernel@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.