public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Greg KH <greg@kroah.com>
Cc: davej@codemonkey.org.uk, ak@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix improper use of pci_module_init() in drivers/char/agp/amd64-agp.c
Date: Thu, 30 Sep 2004 21:20:09 +0200	[thread overview]
Message-ID: <20040930192008.GA28315@wotan.suse.de> (raw)
In-Reply-To: <20040930184248.GA17546@kroah.com>

On Thu, Sep 30, 2004 at 11:42:48AM -0700, Greg KH wrote:
> Hi,
> 
> In going through the tree and auditing the usage of pci_module_init(), I
> noticed that the amd64-agp driver was assuming that the return value of
> this function could be greater than 0 (which is what could happen in 2.2
> and 2.4 kernels.)  As this is no longer true, I think the following
> patch is correct.
> 
> I can add this to my bk-pci tree if you wish, otherwise feel free to
> send it upwards.

There needs to be some replacement for it, you cannot just delete 
the code.


The idea is to run it as fallback when no devices are found. 

How about this patch?

-Andi



diff -u linux-2.6.9rc3-work/drivers/char/agp/amd64-agp.c-o linux-2.6.9rc3-work/drivers/char/agp/amd64-agp.c
--- linux-2.6.9rc3-work/drivers/char/agp/amd64-agp.c-o	2004-09-30 10:35:07.000000000 +0200
+++ linux-2.6.9rc3-work/drivers/char/agp/amd64-agp.c	2004-09-30 21:19:00.000000000 +0200
@@ -627,7 +627,7 @@
 	int err = 0;
 	if (agp_off)
 		return -EINVAL;
-	if (pci_module_init(&agp_amd64_pci_driver) > 0) {
+	if (pci_module_init(&agp_amd64_pci_driver) < 0) {
 		struct pci_dev *dev;
 		if (!agp_try_unsupported && !agp_try_unsupported_boot) {
 			printk(KERN_INFO PFX "No supported AGP bridge found.\n");



  reply	other threads:[~2004-09-30 19:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-30 18:42 [PATCH] fix improper use of pci_module_init() in drivers/char/agp/amd64-agp.c Greg KH
2004-09-30 19:20 ` Andi Kleen [this message]
2004-09-30 19:59   ` Greg KH
2004-09-30 20:06     ` Andi Kleen
2004-09-30 21:05       ` Greg KH
2004-09-30 20:09     ` Greg KH
2004-10-01  1:56 ` Dave Jones

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=20040930192008.GA28315@wotan.suse.de \
    --to=ak@suse.de \
    --cc=davej@codemonkey.org.uk \
    --cc=greg@kroah.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox