mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrzej Krzysztofowicz <ankry@pg.gda.pl>
To: pozsy@sch.bme.hu (Pozsar Balazs)
Cc: linux-kernel@vger.kernel.org (linux-kernel)
Subject: Re: [IDE] meaningless #ifndef?
Date: Tue, 20 Feb 2001 10:47:41 +0100 (MET)	[thread overview]
Message-ID: <200102200947.KAA02817@sunrise.pg.gda.pl> (raw)
In-Reply-To: <Pine.GSO.4.30.0102192252130.7963-100000@balu> from "Pozsar Balazs" at Feb 19, 2001 10:57:32 PM

"Pozsar Balazs wrote:"
> from drivers/ide/ide-features.c:
> 
> /*
>  *  All hosts that use the 80c ribbon mus use!
>  */
> byte eighty_ninty_three (ide_drive_t *drive)
> {
>         return ((byte) ((HWIF(drive)->udma_four) &&
> #ifndef CONFIG_IDEDMA_IVB
>                         (drive->id->hw_config & 0x4000) &&
> #endif /* CONFIG_IDEDMA_IVB */
>                         (drive->id->hw_config & 0x6000)) ? 1 : 0);
> }
> 
> If i see well, then this is always same whether CONFIG_IDEDMA_IVB is
> defined or not.

No, it is not the same. But it duplicates the test when CONFIG_IDEDMA_IVB
is not set. If both tests are done and the first is true, the second also
must be true. If the first is false, the second is meaningless.
Maybe the above code should be:

        return ((byte) ((HWIF(drive)->udma_four) &&
#ifndef CONFIG_IDEDMA_IVB
                        (drive->id->hw_config & 0x4000)
#else
                        (drive->id->hw_config & 0x6000)
#endif /* CONFIG_IDEDMA_IVB */
			) ? 1 : 0);

Just my 0.03 PLN... 
--
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Technical University of Gdansk


  parent reply	other threads:[~2001-02-20  9:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-19 21:57 Pozsar Balazs
2001-02-19 22:31 ` Andre Hedrick
2001-02-19 23:31   ` Bill Wendling
2001-02-19 23:34     ` Andre Hedrick
2001-02-20  4:45     ` Tom Leete
2001-02-20  5:10     ` Tom Leete
2001-02-20  9:47 ` Andrzej Krzysztofowicz [this message]
     [not found] <Pine.LNX.4.21.0102201705280.11260-100000@alloc>
2001-02-20 17:45 ` Hugh Dickins
2001-02-20 18:20   ` Vojtech Pavlik
2001-02-20 19:08     ` Hugh Dickins

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=200102200947.KAA02817@sunrise.pg.gda.pl \
    --to=ankry@pg.gda.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pozsy@sch.bme.hu \
    /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®