linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: JosephChan@via.com.tw
Cc: alan@lxorguk.ukuu.org.uk, linux-ide@vger.kernel.org
Subject: Re: [PATCH 1/2 v1] pata_via.c:  support VX855 and future chips whose IDE controller use 0x0571.
Date: Fri, 16 Jan 2009 23:34:28 +0900	[thread overview]
Message-ID: <49709AF4.4010505@kernel.org> (raw)
In-Reply-To: <C80EF34A3D2E494DBAF9AC29C7AE4EB8087ECECE@exchtp03.taipei.via.com.tw>

Hello, Joseph.

JosephChan@via.com.tw wrote:
> How about this one? Thanks.

Yeap, I like this one much better but I think this can be made a bit
prettier.

> --- a/drivers/ata/pata_via.c	2008-12-25 07:26:37.000000000 +0800
> +++ b/drivers/ata/pata_via.c	2009-01-17 03:34:55.000000000 +0800
> @@ -63,6 +63,7 @@
>  
>  #define DRV_NAME "pata_via"
>  #define DRV_VERSION "0.3.3"
> +#define SINGLE	1 /* To identify single channel controllers */

It's customary to prefix identifiers with something which is somewhat
unique, say, VIA_IDFLAG_SINGLE.  And if it's gonna be flags, the libata way
of doing it is...

enum {
     VIA_IDFLAG_SINGLE		= (1 << 0),
     VIA_IDFLAG_WHATEVER_NEXT	= (1 << 1),
};

and so on...

> @@ -460,6 +463,7 @@
>  	static int printed_version;
>  	u8 enable;
>  	u32 timing;
> +	int single_port = (int) id->driver_data;

How about unsigned long flags = id->driver_data; here

> +	if (single_port)
> +		ppi[1] = &ata_dummy_port_info;
> +	

and flags & VIA_IDFLAG_SINGLE here?

>  	if (!config->id) {
> -		printk(KERN_WARNING "via: Unknown VIA SouthBridge, disabling.\n");
> -		return -ENODEV;
> -	}
> -	pci_dev_put(isa);
> +		printk(KERN_WARNING "via: Unknown VIA SouthBridge.\n");
> +		config = via_isa_bridges;
> +	} else
> +		pci_dev_put(isa);

Also, you can just bypass whole southbridge thing.  Add another flag,
say, VIA_IDFLAG_IGN_SOUTH or something and just skip the whole thing
if the flags is set.

Thanks.

-- 
tejun

  reply	other threads:[~2009-01-16 14:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 11:46 [PATCH 1/2 v1] pata_via.c: support VX855 and future chips whose IDE controller use 0x0571 JosephChan
2009-01-16 14:34 ` Tejun Heo [this message]
2009-01-19 11:26   ` JosephChan
2009-01-22  1:19     ` Tejun Heo
2009-01-22 11:37       ` JosephChan
2009-01-22 23:35         ` Tejun Heo
2009-01-23  3:15           ` JosephChan
2009-01-23  3:33             ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2009-01-15 13:04 JosephChan
2009-01-15 13:40 ` Alan Cox
2009-01-16  0:57   ` JosephChan
2009-01-16 12:15     ` Sergei Shtylyov

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=49709AF4.4010505@kernel.org \
    --to=tj@kernel.org \
    --cc=JosephChan@via.com.tw \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).