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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 14 Sep 2018 15:30:44 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     rkir@...gle.com
Cc:     linux-kernel@...r.kernel.org, tkjos@...gle.com
Subject: Re: [PATCH 07/20] platform: goldfish: pipe: Replace an array of 1
 with a variable

On Mon, Aug 27, 2018 at 11:23:02AM -0700, rkir@...gle.com wrote:
> From: Roman Kiryanov <rkir@...gle.com>
> 
> There is no reason to have an array of 1.
> 
> Signed-off-by: Roman Kiryanov <rkir@...gle.com>
> ---
>  drivers/platform/goldfish/goldfish_pipe.c | 28 +++++++++++------------
>  1 file changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
> index 24e40deb98cc..e9e3e791c0d4 100644
> --- a/drivers/platform/goldfish/goldfish_pipe.c
> +++ b/drivers/platform/goldfish/goldfish_pipe.c
> @@ -205,7 +205,7 @@ struct goldfish_pipe_dev {
>  	unsigned char __iomem *base;
>  };
>  
> -static struct goldfish_pipe_dev pipe_dev[1] = {};
> +struct goldfish_pipe_dev goldfish_pipe_dev;


Why do you need a static structure at all?  Shouldn't this be tied to
the dynamic device the driver core gives you?  That way you can handle
any number of these devices without any code changes needed.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ