All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elias Oltmanns <eo@nebensachen.de>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: ide: Remove ide_spin_wait_hwgroup() and use special requests instead
Date: Wed, 13 Aug 2008 23:16:16 +0200	[thread overview]
Message-ID: <87k5ek1uqn.fsf@denkblock.local> (raw)
In-Reply-To: <200808132232.33425.bzolnier@gmail.com> (Bartlomiej Zolnierkiewicz's message of "Wed, 13 Aug 2008 22:32:32 +0200")

Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> On Wednesday 13 August 2008, Elias Oltmanns wrote:
>> Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
>
>> > Hi,
>> >
>> > On Monday 11 August 2008, Elias Oltmanns wrote:
[...]
>> >> +	rq->cmd_len = DEVSET_CDB_LEN;
>> >> +	ds = (ide_devset_cdb_t *)rq->cmd;
>> >> +	ds->opcode = REQ_DEVSET_EXEC;
>> >> +	ds->arg = arg;
>> >
>> > How's about just doing:
>> >
>> > 	rq->cmd[0] = REQ_DEVSET_EXEC;
>> > 	(int *)rq->cmd[1] = arg;
>> 
>>   CC [M]  drivers/ide/ide-io.o
>> drivers/ide/ide-io.c: In function 'ide_devset_execute':
>> drivers/ide/ide-io.c:748: warning: cast to pointer from integer of different size
>> drivers/ide/ide-io.c:748: error: lvalue required as left operand of assignment
>
> Heh, I must have been falling asleep already when writing this,
> it should have been:
>
> 	*(int *)&rq->cmd[1] = arg;

Well, this I can make sense of.

>
>> Personally, I'd feel more comfortable with casting rq->cmd to a
>> dedicated struct, especially since I'm not exactly a wizard when it
>> comes to casting. Naturally, if you prefer something else (and I get it
>> to work), I'll happily accept that too.
>
> What I find ugly about this dedicated struct is that it overlaps with
> rq->cmd[0] and in all other places we just use rq->cmd[0] directly
> (+ it is very easy for people unfamiliar with the code to overlook it).

Yes, I see.

>
> Then if 'opcode' gets removed all that is left is 'arg' so the struct
> no loger makes much sense.
>
> I fixed it locally (interdiff attached), I hope you're fine with it.

Certainly.

Regards,

Elias

      reply	other threads:[~2008-08-13 21:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 17:37 ide: Remove ide_spin_wait_hwgroup() and use special requests instead Elias Oltmanns
2008-08-12 22:41 ` Bartlomiej Zolnierkiewicz
2008-08-13 15:24   ` Elias Oltmanns
2008-08-13 20:32     ` Bartlomiej Zolnierkiewicz
2008-08-13 21:16       ` Elias Oltmanns [this message]

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=87k5ek1uqn.fsf@denkblock.local \
    --to=eo@nebensachen.de \
    --cc=bzolnier@gmail.com \
    --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 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.