diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-10 22:39:22 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 22:39:22 +0200 |
commit | 1a7809e3499921a016d203b9ee51a77d3cc1dc98 (patch) | |
tree | 5b9186f201cb85565f9f85c0bd1e8679bb204645 /fs/freevxfs | |
parent | 3c619ffd48d7fdb3b17f0df67c4eb4b0bd80e253 (diff) |
ide: re-code ide_fixstring() loop to be less evil
On Friday 25 July 2008, Linus Torvalds wrote:
>
> On Fri, 25 Jul 2008, Ben Dooks wrote:
> >
> > personally, i would much prefer to see the loop being less evil
> > like:
> >
> > for (p = s; p < end; p += 2)
> > be16_to_cpus((u16 *)p);
>
> Well, in this case, the code actually depends on 'p' being back at the
> start of the buffer by the end of it all, so it would need some more
> changes than that.
>
> But yes, I applied David's patch, but I _also_ suspect that we would be
> better off without code that does horrid things like casts and assignments
> inside the function arguments.
>
> So it would be nice to re-code that loop to be more readable. But due to
> the reliance of 'p' being 's' after the loop, the minimal patch would be
> something like the appended.
>
> Bartlomiej - take this or not, I'm not going to commit it - I haven't
> tested it, nor do I even have any machines that would trigger it. So this
> is more a "maybe something like this" than anything else.
From: Linus Torvalds <torvalds@linux-foundation.org>
CC: Ben Dooks <ben-linux@fluff.org>
Cc: David Miller <davem@davemloft.net>
Cc: harvey.harrison@gmail.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'fs/freevxfs')
0 files changed, 0 insertions, 0 deletions