mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: mike.miller@hp.com
Cc: axboe@suse.de, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: cpqarray patches for 2.6 [4 of 5]
Date: Tue, 16 Mar 2004 17:17:20 +0000	[thread overview]
Message-ID: <20040316171720.A2710@infradead.org> (raw)
In-Reply-To: <20040316164642.GE21377@beardog.cca.cpqcorp.net>; from mikem@beardog.cca.cpqcorp.net on Tue, Mar 16, 2004 at 10:46:42AM -0600

On Tue, Mar 16, 2004 at 10:46:42AM -0600, mikem@beardog.cca.cpqcorp.net wrote:
> +int cpqarray_init_step2(void);

Why is this non-static?

>  static int cpqarray_pci_init(ctlr_info_t *c, struct pci_dev *pdev);
>  static void *remap_pci_mem(ulong base, ulong size);
>  static int cpqarray_eisa_detect(void);
> @@ -119,6 +147,9 @@ static void start_fwbk(int ctlr);
>  static cmdlist_t * cmd_alloc(ctlr_info_t *h, int get_from_pool);
>  static void cmd_free(ctlr_info_t *h, cmdlist_t *c, int got_from_pool);
>  
> +static void free_hba(int i);

Argg.  Not holding back this patch, but could you please fix cpqarray
to pass around objects instead of indices?  That's how 90% of the drivers
work, it makes the code more redable and removes global arrays that limit
the max number of devices supported.

> +/* This is a bit of a hack, 
> + * necessary to support both eisa and pci
> + */
> +int __init cpqarray_init(void)
>  {
> -	int i, j;
> -	char buff[4]; 
> +	if(cpqarray_init_step2() == 0) 	/* all the block dev num already used */
> +		return -ENODEV;		/* or no controllers were found */
> +	return 0;
> +}

Why can't cpqarray_init_step2 be inlined in cpqarray_init directly?
Why is cpqarray_init non-static?
And what's the issue with EISA and PCI?  If you converted the driver
to the proper device-model based EISA probing API supporting both should
be really easy.

> +	del_timer(&hba[i]->timer);

You probably want a del_timer_sync here.

> +		if (ida_gendisk[i][j]->flags & GENHD_FL_UP)
> +			del_gendisk(ida_gendisk[i][j]);

How can the gendisk be non up?

> +	if (pci_get_drvdata(pdev) == NULL) {
> +		printk( KERN_ERR "cpqarray: Unable to remove device \n");
> +		return;
>  	}

Rather silly check.  if pci_get_drvdata(pdev) returns NULL the pci code
would be really badly hosed in which case a panic because of a NULL pointer
dereference is probably the best thing to keep the box from corrupting even
more data.


  reply	other threads:[~2004-03-16 17:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 16:46 mikem
2004-03-16 17:17 ` Christoph Hellwig [this message]
2004-03-16 17:37 ` Jeff Garzik
2004-03-16 19:23   ` Jeff Garzik

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=20040316171720.A2710@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.miller@hp.com \
    /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®