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


Groups > linux.kernel > #1576099 > unrolled thread

[PATCH v2] somedriver: remove the initialization of static pointers.

Started byAbdAllah-MEZITI <abdallah.meziti.pro@gmail.com>
First post2017-02-07 23:00 +0100
Last post2017-02-08 00:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] somedriver: remove the initialization of static pointers. AbdAllah-MEZITI <abdallah.meziti.pro@gmail.com> - 2017-02-07 23:00 +0100
    Re: [PATCH v2] somedriver: remove the initialization of static  pointers. Florian Fainelli <f.fainelli@gmail.com> - 2017-02-08 00:10 +0100

#1576099 — [PATCH v2] somedriver: remove the initialization of static pointers.

FromAbdAllah-MEZITI <abdallah.meziti.pro@gmail.com>
Date2017-02-07 23:00 +0100
Subject[PATCH v2] somedriver: remove the initialization of static pointers.
Message-ID<t8lXQ-8l3-17@gated-at.bofh.it>
In C a static pointer will be initialized to NULL.
The §6.7.8 of the ISO/IEC 9899:1999 (E) document says that:
If an object that has static storage duration is not initialized
explicitly, then:
 __ if it has pointer type, it is initialized to a null pointer.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti.pro@gmail.com>

v2: -fix the line-wrapping of the changelog.
    -fix the ref. documentation: C99 standards release,
	and not the draft.
    -this patch is the Task 10 Eudyptula Challenge
	that only fix one code style problem.
---
 drivers/staging/bcm2835-audio/bcm2835.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835.c b/drivers/staging/bcm2835-audio/bcm2835.c
index a84d74d..265fe55 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/bcm2835-audio/bcm2835.c
@@ -28,8 +28,8 @@
  * to debug if we run into issues
  */
 
-static struct snd_card *g_card = NULL;
-static struct bcm2835_chip *g_chip = NULL;
+static struct snd_card *g_card;
+static struct bcm2835_chip *g_chip;
 
 static int snd_bcm2835_free(struct bcm2835_chip *chip)
 {
-- 
2.7.4

[toc] | [next] | [standalone]


#1576147 — Re: [PATCH v2] somedriver: remove the initialization of static pointers.

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-02-08 00:10 +0100
SubjectRe: [PATCH v2] somedriver: remove the initialization of static pointers.
Message-ID<t8n3A-LV-21@gated-at.bofh.it>
In reply to#1576099
On 02/07/2017 01:55 PM, AbdAllah-MEZITI wrote:
> In C a static pointer will be initialized to NULL.
> The §6.7.8 of the ISO/IEC 9899:1999 (E) document says that:
> If an object that has static storage duration is not initialized
> explicitly, then:
>  __ if it has pointer type, it is initialized to a null pointer.

The commit subject should be based on previous submissions, if you do a
git log --oneline drivers/staging/bcm2835-audio/bcm2835.c you will see
that the most frequent subject used was:

Staging: bcm2835-audio:

So you should utilize the same subject prefix, and make your prefix be
something like:

Staging: bcm2835-audio: Remove the initialization of static pointers

> 
> Signed-off-by: AbdAllah-MEZITI <abdallah.meziti.pro@gmail.com>
> 
> v2: -fix the line-wrapping of the changelog.
>     -fix the ref. documentation: C99 standards release,
> 	and not the draft.
>     -this patch is the Task 10 Eudyptula Challenge
> 	that only fix one code style problem.
> ---
>  drivers/staging/bcm2835-audio/bcm2835.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/bcm2835-audio/bcm2835.c b/drivers/staging/bcm2835-audio/bcm2835.c
> index a84d74d..265fe55 100644
> --- a/drivers/staging/bcm2835-audio/bcm2835.c
> +++ b/drivers/staging/bcm2835-audio/bcm2835.c
> @@ -28,8 +28,8 @@
>   * to debug if we run into issues
>   */
>  
> -static struct snd_card *g_card = NULL;
> -static struct bcm2835_chip *g_chip = NULL;
> +static struct snd_card *g_card;
> +static struct bcm2835_chip *g_chip;
>  
>  static int snd_bcm2835_free(struct bcm2835_chip *chip)
>  {
> 


-- 
Florian

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web