Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1543884 > unrolled thread

[PATCH] solo6x10: use designated initializers

Started byKees Cook <keescook@chromium.org>
First post2016-12-17 02:10 +0100
Last post2016-12-19 21:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] solo6x10: use designated initializers Kees Cook <keescook@chromium.org> - 2016-12-17 02:10 +0100
    Re: [PATCH] solo6x10: use designated initializers Andrey Utkin <andrey.utkin@corp.bluecherry.net> - 2016-12-19 21:00 +0100

#1543884 — [PATCH] solo6x10: use designated initializers

FromKees Cook <keescook@chromium.org>
Date2016-12-17 02:10 +0100
Subject[PATCH] solo6x10: use designated initializers
Message-ID<sPbFE-2GI-33@gated-at.bofh.it>
Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
index 6a35107aca25..36e93540bb49 100644
--- a/drivers/media/pci/solo6x10/solo6x10-g723.c
+++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
@@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
 
 int solo_g723_init(struct solo_dev *solo_dev)
 {
-	static struct snd_device_ops ops = { NULL };
+	static struct snd_device_ops ops = { };
 	struct snd_card *card;
 	struct snd_kcontrol_new kctl;
 	char name[32];
-- 
2.7.4


-- 
Kees Cook
Nexus Security

[toc] | [next] | [standalone]


#1544751

FromAndrey Utkin <andrey.utkin@corp.bluecherry.net>
Date2016-12-19 21:00 +0100
Message-ID<sQcgi-3KI-9@gated-at.bofh.it>
In reply to#1543884
On Fri, Dec 16, 2016 at 05:05:36PM -0800, Kees Cook wrote:
> Prepare to mark sensitive kernel structures for randomization by making
> sure they're using designated initializers. These were identified during
> allyesconfig builds of x86, arm, and arm64, with most initializer fixes
> extracted from grsecurity.

Ok I've reviewed all the patchset, googled a bit and now I see what's
going on.

> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> index 6a35107aca25..36e93540bb49 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>  
>  int solo_g723_init(struct solo_dev *solo_dev)
>  {
> -	static struct snd_device_ops ops = { NULL };
> +	static struct snd_device_ops ops = { };

I'm not that keen on syntax subtleties, but...
 * Empty initializer is not quite "designated" as I can judge.
 * From brief googling I see that empty initializer is not valid in
   some C standards.

Since `ops` is static, what about this?
For the variant given below, you have my signoff.

> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>  
>  int solo_g723_init(struct solo_dev *solo_dev)
>  {
> -	static struct snd_device_ops ops = { NULL };
> +	static struct snd_device_ops ops;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web