All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus@drzeus.cx>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: rmk+lkml@arm.linux.org.uk, linux-kernel@vger.kernel.org,
	jgarzik@pobox.com
Subject: Re: [PATCH 2/2] [MMC] Secure Digital Host Controller Interface driver
Date: Sun, 12 Feb 2006 18:24:49 +0100	[thread overview]
Message-ID: <43EF6F61.6000407@drzeus.cx> (raw)
In-Reply-To: <20060212201407.70761172.vsu@altlinux.ru>

Sergey Vlasov wrote:

> The interrupt handler can be called immediately after request_irq()
> completes (even if you are sure that the device itself cannot generate
> interrupts at this point, the interrupt line can be shared).  And
> host->lock is not yet initialized - oops...
> 

Ah. I'll fix that.

> 
> The same problem as with request_irq(), just from the other side - until
> free_irq() returns, you may still get calls to your interrupt handler,
> and host->ioaddr is already unmapped - oops again.
> 

Ditto.

>> +
>> +	mmc_free_host(mmc);
>> +}
>> +
>> +static int __devinit sdhci_probe(struct pci_dev *pdev,
>> +	const struct pci_device_id *ent)
>> +{
>> +	int ret, i;
>> +	u8 slots;
>> +	struct sdhci_chip *chip;
>> +
>> +	BUG_ON(pdev == NULL);
>> +	BUG_ON(ent == NULL);
> 
> IMHO these BUG_ON() calls are overkill.
> 

I prefer BUG_ON():s since they print a line number. A page fault induced
oops just gives me a byte offset into the compiled function.

> [...]
>> +typedef struct sdhci_host *sdhci_host_p;
> 
> The general policy seems to be "typedefs are evil"...

Fair enough. It didn't get much usage anyway.


Thanks for the code review. :)

Rgds
Pierre

  reply	other threads:[~2006-02-12 17:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11  0:15 [PATCH 1/2] [PCI] Secure Digital Host Controller id and regs Pierre Ossman
2006-02-11  0:15 ` [PATCH 2/2] [MMC] Secure Digital Host Controller Interface driver Pierre Ossman
2006-02-12 10:01   ` Andrew Morton
2006-02-12 10:20     ` Pierre Ossman
2006-02-12 17:14   ` Sergey Vlasov
2006-02-12 17:24     ` Pierre Ossman [this message]
2006-02-18 22:08     ` Pierre Ossman
2006-02-12 15:28 ` [PATCH 1/2] [PCI] Secure Digital Host Controller id and regs Sergey Vlasov
2006-02-12 15:36   ` Pierre Ossman
2006-02-18 22:07   ` Pierre Ossman

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=43EF6F61.6000407@drzeus.cx \
    --to=drzeus@drzeus.cx \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=vsu@altlinux.ru \
    /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.