[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080205044707.GA29807@gollum.tnic>
Date: Tue, 5 Feb 2008 05:47:07 +0100
From: Borislav Petkov <petkovbb@...glemail.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-ide@...r.kernel.org
Subject: Re: [PATCH 07/22] ide-tape: struct idetape_tape_t: shorten member
names v2
On Tue, Feb 05, 2008 at 02:23:21AM +0100, Bartlomiej Zolnierkiewicz wrote:
> On Monday 04 February 2008, Borislav Petkov wrote:
> > Shorten some member names not too aggressively since this driver might be gone
> > anyway soon.
> >
> > Signed-off-by: Borislav Petkov <petkovbb@...il.com>
> > ---
> > drivers/ide/ide-tape.c | 210 ++++++++++++++++++++++++++----------------------
> > 1 files changed, 113 insertions(+), 97 deletions(-)
> >
> > diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
> > index 126e8a9..0b5ccce 100644
> > --- a/drivers/ide/ide-tape.c
> > +++ b/drivers/ide/ide-tape.c
>
> [...]
>
> > @@ -1583,7 +1579,8 @@ static void idetape_create_read_cmd(idetape_tape_t *tape, idetape_pc_t *pc, unsi
> > pc->bh = bh;
> > atomic_set(&bh->b_count, 0);
> > pc->buffer = NULL;
> > - pc->request_transfer = pc->buffer_size = length * tape->tape_block_size;
> > + pc->buffer_size = length * tape->blk_size;
> > + pc->request_transfer = length * tape->blk_size;
> > if (pc->request_transfer == tape->stage_size)
> > set_bit(PC_DMA_RECOMMENDED, &pc->flags);
> > }
> > @@ -1621,7 +1618,8 @@ static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc, uns
> > pc->b_data = bh->b_data;
> > pc->b_count = atomic_read(&bh->b_count);
> > pc->buffer = NULL;
> > - pc->request_transfer = pc->buffer_size = length * tape->tape_block_size;
> > + pc->request_transfer = length * tape->blk_size;
> > + pc->buffer_size = length * tape->blk_size;
> > if (pc->request_transfer == tape->stage_size)
> > set_bit(PC_DMA_RECOMMENDED, &pc->flags);
> > }
>
> for some reason gcc doesn't seem to optimize the new code as well as
> the old one (=> driver size goes up instead of staying unchanged)
>
> interdiff between original patch and merged version:
>
> diff -u b/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
> --- b/drivers/ide/ide-tape.c
> +++ b/drivers/ide/ide-tape.c
> @@ -324,7 +324,7 @@
> /* Current character device data transfer direction */
> u8 chrdev_dir;
>
> - /* tape block size, usu. 512 or 1024 bytes */
> + /* tape block size, usually 512 or 1024 bytes */
> unsigned short blk_size;
> int user_bs_factor;
>
> @@ -1580,8 +1580,8 @@
> pc->bh = bh;
> atomic_set(&bh->b_count, 0);
> pc->buffer = NULL;
> - pc->buffer_size = length * tape->blk_size;
> - pc->request_transfer = length * tape->blk_size;
> + pc->buffer_size = length * tape->blk_size;
> + pc->request_transfer = pc->buffer_size;
> if (pc->request_transfer == tape->stage_size)
> set_bit(PC_DMA_RECOMMENDED, &pc->flags);
> }
> @@ -1619,8 +1619,8 @@
> pc->b_data = bh->b_data;
> pc->b_count = atomic_read(&bh->b_count);
> pc->buffer = NULL;
> - pc->request_transfer = length * tape->blk_size;
> - pc->buffer_size = length * tape->blk_size;
> + pc->buffer_size = length * tape->blk_size;
> + pc->request_transfer = pc->buffer_size;
> if (pc->request_transfer == tape->stage_size)
> set_bit(PC_DMA_RECOMMENDED, &pc->flags);
> }
Yeah, i did that only because checkpatch.pl complained that multiple assignments
should be avoided. Now it looks kinda dumb that way besides improving readability
so converting it to the best form w.r.t generating smaller binary would be a reason
good enough to ignore checkpatch.pl in that case.
--
Regards/Gruß,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists