mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: R.E.Wolff@BitWizard.nl
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] rio: typo in bitwise AND expression.
Date: Wed, 22 Nov 2006 23:58:56 +0100	[thread overview]
Message-ID: <20061122225856.GB10758@1wt.eu> (raw)

Hi Rogier,

here's a patch to fix a typo in rio_linux which affects both
kernel 2.4 and 2.6. It's not big deal it seems as it only
affects the irq-less path.

I found this one like that :

 $ grep -r '[^&]&[^&]*![^=]' drivers/char/

I'm sure others will find more efficient rules to catch such
errors.

Regards,
Willy

>From 4fb85842b76ad28893ea2aeaeb6dbc4e3f5a2dee Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Wed, 22 Nov 2006 23:54:48 +0100
Subject: [PATCH] rio: typo in bitwise AND expression.

The line :

    hp->Mode &= !RIO_PCI_INT_ENABLE;

is obviously wrong as RIO_PCI_INT_ENABLE=0x04 and is used as a bitmask
2 lines before. Getting no IRQ would not disable RIO_PCI_INT_ENABLE
but rather RIO_PCI_BOOT_FROM_RAM which equals 0x01.

Obvious fix is to change ! for ~.

Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 drivers/char/rio/rio_linux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 7ac68cb..3228fad 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -1143,7 +1143,7 @@ #endif				/* PCI */
 				rio_dprintk(RIO_DEBUG_INIT, "Enabling interrupts on rio card.\n");
 				hp->Mode |= RIO_PCI_INT_ENABLE;
 			} else
-				hp->Mode &= !RIO_PCI_INT_ENABLE;
+				hp->Mode &= ~RIO_PCI_INT_ENABLE;
 			rio_dprintk(RIO_DEBUG_INIT, "New Mode: %x\n", hp->Mode);
 			rio_start_card_running(hp);
 		}
-- 
1.4.2.4


             reply	other threads:[~2006-11-22 22:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-22 22:58 Willy Tarreau [this message]
2006-11-23 14:11 ` Patrick vd Lageweg
2006-11-23 21:15   ` Willy Tarreau
2006-11-24 18:58 ` [PATCH] 6pack: fix "&= !" typo Alexey Dobriyan
2006-11-24 20:21   ` Ralf Baechle
2006-11-24 21:23     ` Willy Tarreau
2006-11-24 21:42       ` Ralf Baechle

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=20061122225856.GB10758@1wt.eu \
    --to=w@1wt.eu \
    --cc=R.E.Wolff@BitWizard.nl \
    --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 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®