lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4cefeab80705220208w2200b2f1x1d7a8c7e0c01dfb9@mail.gmail.com>
Date:	Tue, 22 May 2007 14:38:35 +0530
From:	"Nitin Gupta" <nitingupta910@...il.com>
To:	"Andrey Panin" <pazke@...pac.ru>, linux-kernel@...r.kernel.org
Cc:	"Richard Purdie" <richard@...nedhand.com>
Subject: Re: [RFC] LZO1X de/compression support

Hi,

On 5/18/07, Andrey Panin <pazke@...pac.ru> wrote:
> On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote:
> > +     register const unsigned char *ip;
>
> register keyword is meaningless for today's compiler.

But can we assume that gcc is being used? What if we use compiler for
which it does matter (can't give example for this...)?

>
> > +     unsigned char *op;
> > +     const unsigned char * const in_end = in + in_len;
> > +     const unsigned char * const ip_end = in + in_len - M2_MAX_LEN - 5;
> > +     const unsigned char *ii;
> > +     const unsigned char ** const dict = (const unsigned char **)workmem;
> > +
> > +     op = out;
>
> Why not write this as `unsigned char *op = out;` ?
>

Done.

> Empty if() body ?

No empty if() now.

> > +                     m_off -= 0x4000;
>
> What's this magic number 0x4000 repeated everywhere ? M3_MAX_OFFSET perhaps ?

I don't know :)

> > +#if defined(__LITTLE_ENDIAN)
> > +                             m_pos = op - 1;
> > +                             m_pos -= (*(const unsigned short *)ip) >> 2;
> > +#else
> > +                             m_pos = op - 1;
> > +                             m_pos -= (ip[0] >> 2) + (ip[1] << 6);
> > +#endif
>
> IMHO you could write it this way:
>
> m_pos = op - 1 - (le16_to_cpu(*(const u16 *)ip) >> 2);
>

Shouldn't this be cpu_to_le16() ?


> > +#if defined(__LITTLE_ENDIAN)
> > +                             m_pos -= (*(const unsigned short *)ip) >> 2;
> > +#else
> > +                             m_pos -= (ip[0] >> 2) + (ip[1] << 6);
> > +#endif
>
> m_pos -= le16_to_cpu(*(const u16 *)ip) >> 2;

cpu_to_le16() ?


---
Can you please snip-out irrelevant code parts. It is real pain for
eyes to sneek out your comments otherwise :)


Thanks for your comments.


Cheers,
Nitin
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ