Re: Re: [PATCH] staging: gdm724: adding kernel endianness header
From: Jaime Arrocha
Date: Sat May 09 2015 - 12:55:36 EST
---- On Sat, 09 May 2015 05:59:40 -0500 Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote ----
> On Fri, May 08, 2015 at 06:29:24PM -0500, Jaime Arrocha wrote:
> > >From TODO list: remove test for host endian
> > Included header to gather information about host endianness.
> > Please let me know if the code addition requires corrections
> > to meet standards.
> >
>
> No. This isn't really an improvement. We need to get rid of ->host_ed
> entirely. Which is actually easy. Basically change gdm_cpu_to_dev16()
> and friends to do so something:
>
> u16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x)
> {
> if (ed->dev_ed == ENDIANNESS_LITTLE)
> return cpu_to_le16(x);
> else
> return cpu_to_be16(x);
> }
>
> regards,
> dan carpenter
>
>
You are right, I will dive a little further to find out the use for host_ed and eliminate it. I did
read an email from a while ago where one author mentioned that he needed to keep this function.
Also, the kernel already has functions to swap numbers for endianness. Will you rather use those?
Thanks for your feedback,
Jaime
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/