mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	kyle@canonical.com
Subject: Re: HPA patches
Date: Fri, 23 Mar 2007 20:08:19 +0000	[thread overview]
Message-ID: <20070323200819.4e734f4f@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20070323112411.f6a8a762.randy.dunlap@oracle.com>

> > +static int ata_ignore_hpa = 0;
> 
> Don't init to 0.  Not needed, bloats binary files.

It'll be one for the final release 8)

> > +module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644);
> > +MODULE_PARM_DESC(ignore_hpa, "Ignore HPA (0=off 1=on)");
> 
> So 1 = on = ignore, right?

Yes.

> > +	tf.command = ATA_CMD_READ_NATIVE_MAX_EXT;
> > +	tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 | ATA_TFLAG_ISADDR;
> > +	tf.protocol |= ATA_PROT_NODATA;
> > +	tf.device = 0x40;
> 
> What is 0x40?  can it be #defined (or enum-ed) instead of a magic
> value?  please?  (more of same below)

It's 0x40. Its a "command dependant bit" - no useful name.

> > +	u64 sectors = dev->n_sectors;
> > +	u64 hpa_sectors;
> > +	
> > +	if (ata_id_has_lba48(dev->id))
> > +		hpa_sectors = ata_read_native_max_address_ext(dev);
> > +	else
> > +		hpa_sectors = ata_read_native_max_address(dev);
> > +
> > +	/* if no hpa, both should be equal */
> > +	ata_dev_printk(dev, KERN_INFO, "%s 1: sectors = %lld, hpa_sectors = %lld\n",
> > +		__FUNCTION__, sectors, hpa_sectors);
> 
> (long long) or (unsigned long long) on sectors and hpa_sectors...

u64 is always unsigned long long (and its debug anyway)

> 
> > +
> > +	if (hpa_sectors > sectors) {
> > +		ata_dev_printk(dev, KERN_INFO,
> > +			"Host Protected Area detected:\n"
> > +			"\tcurrent size: %lld sectors\n"
> > +			"\tnative size: %lld sectors\n",
> > +			sectors, hpa_sectors);
> 
> printk format types ok?

Yes

> > +			if (hpa_sectors) {
> > +				ata_dev_printk(dev, KERN_INFO,
> > +					"native size increased to %lld sectors\n", hpa_sectors);
> 
> Line lengths < 80 and printk format types?

See above, and the 80 column fascists can suffer in the name of
readability. 

Alan

  reply	other threads:[~2007-03-23 19:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23 19:13 Alan Cox
2007-03-23 18:24 ` Randy Dunlap
2007-03-23 20:08   ` Alan Cox [this message]
2007-03-23 19:22     ` David Miller
2007-03-23 21:51       ` Alan Cox
2007-03-23 20:03     ` Randy Dunlap
2007-03-23 21:47       ` Alan Cox
2007-03-23 22:47         ` Chuck Ebbert
2007-04-13  3:16       ` Kyle McMartin
2007-04-13 10:56         ` Alan Cox
2007-03-23 20:56 ` Matthew Garrett
2007-03-27  5:00   ` Jeff Garzik
2007-03-26 20:45 ` Kyle McMartin
2007-03-28  0:08 ` Matthew Garrett
2007-03-28  0:16   ` Matthew Garrett
2007-03-28  1:16     ` ata_piix can't drive Mac hardware properly Matthew Garrett
2007-03-28  4:07       ` Matthew Garrett
2007-03-28  9:57   ` HPA patches Alan Cox
2007-03-28 20:08     ` Matthew Garrett
2007-03-28 21:54       ` Alan Cox
2007-03-28 21:28         ` Matthew Garrett
2007-03-28 21:30         ` Kyle McMartin

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=20070323200819.4e734f4f@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=kyle@canonical.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.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®