mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ioe-lkml@rameria.de>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] libata queue updated
Date: Mon, 30 Jan 2006 20:02:17 +0100	[thread overview]
Message-ID: <200601302002.18962.ioe-lkml@rameria.de> (raw)
In-Reply-To: <43DDD206.6000502@gmail.com>

Hi,

On Monday 30 January 2006 09:44, Tejun Heo wrote:
> So, are you saying....
> 
> struct ata_classes {
> 	unsigned int classes[2];
> |;
> 
> is safer than
> 
> unsigned int *class;
> 
> ?
 
No, but with a little bit of additional code it CAN be safer.

Or maybe, we can store the classification in a different way.

What about putting the information directly into "ap->device[INDEX].class" 
in the sole caller (ata_drive_probe_reset) so far?

> > So please let the core layer pass a bounded array here or provide
> > a function from core layer to set that and check the index.
> > 
> 
> Can you show me what you have in mind as code?
 
/* Define this to 15, if you need to */
#define ATA_MAX_CLASSES 2
struct ata_set {
        unsigned int class[ATA_MAX_CLASSES];
};

void set_ata_class(struct ata_set *cls, unsigned int idx, unsigned int what)
{
        BUG_ON(idx >= ARRAY_SIZE(cls->class);
        cls->class[idx] = what;
}

set_ata_class(&myclass, 0, what);

You can enforce that even better by making "what" 
a typedef like we do it with pte/pmd/pud/pgd in the VM.

But I prefer not passing this class stuff around, which would even safe
arguments and thus reduce code size.

Maybe we should even have a classify ata port operation instead?


Regards

Ingo Oeser


  reply	other threads:[~2006-01-30 19:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-28 18:25 Jeff Garzik
2006-01-29 16:11 ` Ingo Oeser
2006-01-30  7:04   ` Tejun Heo
2006-01-30  8:36     ` Ingo Oeser
2006-01-30  8:44       ` Tejun Heo
2006-01-30 19:02         ` Ingo Oeser [this message]
2006-01-31  0:04           ` Tejun
2006-01-31  2:33             ` Ingo Oeser
2006-01-31  2:41               ` Tejun
2006-01-30 15:01     ` 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=200601302002.18962.ioe-lkml@rameria.de \
    --to=ioe-lkml@rameria.de \
    --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

Powered by JetHome