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: <5512D92D.3020809@schinagl.nl>
Date:	Wed, 25 Mar 2015 16:50:05 +0100
From:	Olliver Schinagl <oliver@...inagl.nl>
To:	Thomas Niederprüm <niederp@...sik.uni-kl.de>,
	plagnioj@...osoft.com, tomi.valkeinen@...com,
	maxime.ripard@...e-electrons.com, kernel@...gutronix.de,
	shawn.guo@...aro.org, robh+dt@...nel.org
CC:	linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv5 11/11] fbdev: ssd1307fb: Add blank mode

Hey Thomas,

On 24-03-15 22:23, Thomas Niederprüm wrote:
> This patch adds ssd1307fb_blank() to make the framebuffer capable
> of blanking.
>
> Signed-off-by: Thomas Niederprüm <niederp@...sik.uni-kl.de>
> ---
>   drivers/video/fbdev/ssd1307fb.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 061cc95..9101b27 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -238,6 +238,18 @@ static ssize_t ssd1307fb_write(struct fb_info *info, const char __user *buf,
>   	return count;
>   }
>
> +static int ssd1307fb_blank(int blank_mode, struct fb_info *info)
> +{
> +	struct ssd1307fb_par *par = info->par;
> +	int ret;
> +
> +	if (blank_mode != FB_BLANK_UNBLANK)
> +		ret = ssd1307fb_write_cmd(par->client, SSD1307FB_DISPLAY_OFF);
> +	else
> +		ret = ssd1307fb_write_cmd(par->client, SSD1307FB_DISPLAY_ON);
I'd probably add an extra return, or drop the ret var at all and just 
return the function.

or even shorter :)
return sd1307fb_write_cmd(par->client, (blank_mode != FB_BLANK_UNBLANK) 
? SSD1307FB_DISPLAY_OFF : SSD1307FB_DISPLAY_ON;

Olliver
> +	return ret;
> +}
> +
>   static void ssd1307fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
>   {
>   	struct ssd1307fb_par *par = info->par;
> @@ -263,6 +275,7 @@ static struct fb_ops ssd1307fb_ops = {
>   	.owner		= THIS_MODULE,
>   	.fb_read	= fb_sys_read,
>   	.fb_write	= ssd1307fb_write,
> +	.fb_blank	= ssd1307fb_blank,
>   	.fb_fillrect	= ssd1307fb_fillrect,
>   	.fb_copyarea	= ssd1307fb_copyarea,
>   	.fb_imageblit	= ssd1307fb_imageblit,
>

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