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]
Date:	Tue, 14 Jul 2015 20:05:08 -0700
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
Cc:	devel@...verdev.osuosl.org, linux-fbdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH 4/5] staging: sm7xxfb: define new macros

On Tue, Jul 07, 2015 at 01:44:36PM +0530, Sudip Mukherjee wrote:
> Define and use some new macros to work with different situations
> based on little-endian and big-endian.
> 
> Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
> ---
>  drivers/staging/sm7xxfb/sm7xx.h   | 19 ++++++++++++++++
>  drivers/staging/sm7xxfb/sm7xxfb.c | 48 ++++++++-------------------------------
>  2 files changed, 29 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/staging/sm7xxfb/sm7xx.h b/drivers/staging/sm7xxfb/sm7xx.h
> index 31a21bd..6905177 100644
> --- a/drivers/staging/sm7xxfb/sm7xx.h
> +++ b/drivers/staging/sm7xxfb/sm7xx.h
> @@ -95,3 +95,22 @@ struct modeinit {
>  	unsigned char init_cr30_cr4d[SIZE_CR30_CR4D];
>  	unsigned char init_cr90_cra7[SIZE_CR90_CRA7];
>  };
> +
> +#ifdef __BIG_ENDIAN
> +#define pal_rgb(r, g, b, val)	(((r & 0xf800) >> 8) | \
> +				((g & 0xe000) >> 13) | \
> +				((g & 0x1c00) << 3) | \
> +				((b & 0xf800) >> 3))
> +#define big_addr		0x800000
> +#define mmio_addr		0x00800000
> +#define seqw17			smtc_seqw(0x17, 0x30)
> +#define big_pixel_depth(p, d)	{if (p == 24) {p = 32; d = 32; } }
> +#define big_swap(p)		((p & 0xff00ff00 >> 8) | (p & 0x00ff00ff << 8))
> +#else
> +#define pal_rgb(r, g, b, val)	val
> +#define big_addr		0
> +#define mmio_addr		0x00c00000
> +#define seqw17

Odd, empty macros are not good, because:

> -#ifdef __BIG_ENDIAN
>  		if (sfb->fb->var.bits_per_pixel == 32)
> -			smtc_seqw(0x17, 0x30);
> -#endif
> +			seqw17;

That just looks wrong :(

--
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