* [PATCH 1/1] OCFS2: Remove NULL assignments on static
@ 2014-04-08 20:13 ` Fabian Frederick
0 siblings, 0 replies; 8+ messages in thread
From: Fabian Frederick @ 2014-04-08 20:13 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, ocfs2-devel
static values are automatically initialized to NULL.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: ocfs2-devel@oss.oracle.com
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/ocfs2/cluster/tcp.c | 2 +-
fs/ocfs2/dlm/dlmdebug.c | 2 +-
fs/ocfs2/dlm/dlmlock.c | 2 +-
fs/ocfs2/dlm/dlmmaster.c | 6 +++---
fs/ocfs2/stackglue.c | 2 +-
fs/ocfs2/super.c | 4 ++--
fs/ocfs2/uptodate.c | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index eb649d2..161fb1e 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -108,7 +108,7 @@ static struct rb_root o2net_handler_tree = RB_ROOT;
static struct o2net_node o2net_nodes[O2NM_MAX_NODES];
/* XXX someday we'll need better accounting */
-static struct socket *o2net_listen_sock = NULL;
+static struct socket *o2net_listen_sock;
/*
* listen work is only queued by the listening socket callbacks on the
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index e33cd7a..18f13c2 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -338,7 +338,7 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle)
#ifdef CONFIG_DEBUG_FS
-static struct dentry *dlm_debugfs_root = NULL;
+static struct dentry *dlm_debugfs_root;
#define DLM_DEBUGFS_DIR "o2dlm"
#define DLM_DEBUGFS_DLM_STATE "dlm_state"
diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
index 5d32f75..66c2a49 100644
--- a/fs/ocfs2/dlm/dlmlock.c
+++ b/fs/ocfs2/dlm/dlmlock.c
@@ -52,7 +52,7 @@
#define MLOG_MASK_PREFIX ML_DLM
#include "cluster/masklog.h"
-static struct kmem_cache *dlm_lock_cache = NULL;
+static struct kmem_cache *dlm_lock_cache;
static DEFINE_SPINLOCK(dlm_cookie_lock);
static u64 dlm_next_cookie = 1;
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index af3f7aa..fd07ef9 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -82,9 +82,9 @@ static inline int dlm_mle_equal(struct dlm_ctxt *dlm,
return 1;
}
-static struct kmem_cache *dlm_lockres_cache = NULL;
-static struct kmem_cache *dlm_lockname_cache = NULL;
-static struct kmem_cache *dlm_mle_cache = NULL;
+static struct kmem_cache *dlm_lockres_cache;
+static struct kmem_cache *dlm_lockname_cache;
+static struct kmem_cache *dlm_mle_cache;
static void dlm_mle_release(struct kref *kref);
static void dlm_init_mle(struct dlm_master_list_entry *mle,
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 83f1a66..5d965e8 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -709,7 +709,7 @@ static struct ctl_table ocfs2_root_table[] = {
{ }
};
-static struct ctl_table_header *ocfs2_table_header = NULL;
+static struct ctl_table_header *ocfs2_table_header;
/*
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index a7cdd56..9027729 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -75,7 +75,7 @@
#include "buffer_head_io.h"
-static struct kmem_cache *ocfs2_inode_cachep = NULL;
+static struct kmem_cache *ocfs2_inode_cachep;
struct kmem_cache *ocfs2_dquot_cachep;
struct kmem_cache *ocfs2_qf_chunk_cachep;
@@ -85,7 +85,7 @@ struct kmem_cache *ocfs2_qf_chunk_cachep;
* workqueue and schedule on our own. */
struct workqueue_struct *ocfs2_wq = NULL;
-static struct dentry *ocfs2_debugfs_root = NULL;
+static struct dentry *ocfs2_debugfs_root;
MODULE_AUTHOR("Oracle");
MODULE_LICENSE("GPL");
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index 52eaf33..82e17b0 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -67,7 +67,7 @@ struct ocfs2_meta_cache_item {
sector_t c_block;
};
-static struct kmem_cache *ocfs2_uptodate_cachep = NULL;
+static struct kmem_cache *ocfs2_uptodate_cachep;
u64 ocfs2_metadata_cache_owner(struct ocfs2_caching_info *ci)
{
--
1.8.4.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
@ 2014-04-08 20:13 ` Fabian Frederick
0 siblings, 0 replies; 8+ messages in thread
From: Fabian Frederick @ 2014-04-08 20:13 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, ocfs2-devel
static values are automatically initialized to NULL.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: ocfs2-devel at oss.oracle.com
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/ocfs2/cluster/tcp.c | 2 +-
fs/ocfs2/dlm/dlmdebug.c | 2 +-
fs/ocfs2/dlm/dlmlock.c | 2 +-
fs/ocfs2/dlm/dlmmaster.c | 6 +++---
fs/ocfs2/stackglue.c | 2 +-
fs/ocfs2/super.c | 4 ++--
fs/ocfs2/uptodate.c | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index eb649d2..161fb1e 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -108,7 +108,7 @@ static struct rb_root o2net_handler_tree = RB_ROOT;
static struct o2net_node o2net_nodes[O2NM_MAX_NODES];
/* XXX someday we'll need better accounting */
-static struct socket *o2net_listen_sock = NULL;
+static struct socket *o2net_listen_sock;
/*
* listen work is only queued by the listening socket callbacks on the
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index e33cd7a..18f13c2 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -338,7 +338,7 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle)
#ifdef CONFIG_DEBUG_FS
-static struct dentry *dlm_debugfs_root = NULL;
+static struct dentry *dlm_debugfs_root;
#define DLM_DEBUGFS_DIR "o2dlm"
#define DLM_DEBUGFS_DLM_STATE "dlm_state"
diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
index 5d32f75..66c2a49 100644
--- a/fs/ocfs2/dlm/dlmlock.c
+++ b/fs/ocfs2/dlm/dlmlock.c
@@ -52,7 +52,7 @@
#define MLOG_MASK_PREFIX ML_DLM
#include "cluster/masklog.h"
-static struct kmem_cache *dlm_lock_cache = NULL;
+static struct kmem_cache *dlm_lock_cache;
static DEFINE_SPINLOCK(dlm_cookie_lock);
static u64 dlm_next_cookie = 1;
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index af3f7aa..fd07ef9 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -82,9 +82,9 @@ static inline int dlm_mle_equal(struct dlm_ctxt *dlm,
return 1;
}
-static struct kmem_cache *dlm_lockres_cache = NULL;
-static struct kmem_cache *dlm_lockname_cache = NULL;
-static struct kmem_cache *dlm_mle_cache = NULL;
+static struct kmem_cache *dlm_lockres_cache;
+static struct kmem_cache *dlm_lockname_cache;
+static struct kmem_cache *dlm_mle_cache;
static void dlm_mle_release(struct kref *kref);
static void dlm_init_mle(struct dlm_master_list_entry *mle,
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 83f1a66..5d965e8 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -709,7 +709,7 @@ static struct ctl_table ocfs2_root_table[] = {
{ }
};
-static struct ctl_table_header *ocfs2_table_header = NULL;
+static struct ctl_table_header *ocfs2_table_header;
/*
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index a7cdd56..9027729 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -75,7 +75,7 @@
#include "buffer_head_io.h"
-static struct kmem_cache *ocfs2_inode_cachep = NULL;
+static struct kmem_cache *ocfs2_inode_cachep;
struct kmem_cache *ocfs2_dquot_cachep;
struct kmem_cache *ocfs2_qf_chunk_cachep;
@@ -85,7 +85,7 @@ struct kmem_cache *ocfs2_qf_chunk_cachep;
* workqueue and schedule on our own. */
struct workqueue_struct *ocfs2_wq = NULL;
-static struct dentry *ocfs2_debugfs_root = NULL;
+static struct dentry *ocfs2_debugfs_root;
MODULE_AUTHOR("Oracle");
MODULE_LICENSE("GPL");
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index 52eaf33..82e17b0 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -67,7 +67,7 @@ struct ocfs2_meta_cache_item {
sector_t c_block;
};
-static struct kmem_cache *ocfs2_uptodate_cachep = NULL;
+static struct kmem_cache *ocfs2_uptodate_cachep;
u64 ocfs2_metadata_cache_owner(struct ocfs2_caching_info *ci)
{
--
1.8.4.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
2014-04-08 20:13 ` [Ocfs2-devel] " Fabian Frederick
@ 2014-04-09 0:53 ` Wengang
-1 siblings, 0 replies; 8+ messages in thread
From: Wengang @ 2014-04-09 0:53 UTC (permalink / raw)
To: Fabian Frederick, linux-kernel; +Cc: ocfs2-devel
Hi Fabian,
What's the badness if we do the assignments?
thanks,
wengang
于 2014年04月09日 04:13, Fabian Frederick 写道:
> static values are automatically initialized to NULL.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: ocfs2-devel@oss.oracle.com
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> fs/ocfs2/cluster/tcp.c | 2 +-
> fs/ocfs2/dlm/dlmdebug.c | 2 +-
> fs/ocfs2/dlm/dlmlock.c | 2 +-
> fs/ocfs2/dlm/dlmmaster.c | 6 +++---
> fs/ocfs2/stackglue.c | 2 +-
> fs/ocfs2/super.c | 4 ++--
> fs/ocfs2/uptodate.c | 2 +-
> 7 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
> index eb649d2..161fb1e 100644
> --- a/fs/ocfs2/cluster/tcp.c
> +++ b/fs/ocfs2/cluster/tcp.c
> @@ -108,7 +108,7 @@ static struct rb_root o2net_handler_tree = RB_ROOT;
> static struct o2net_node o2net_nodes[O2NM_MAX_NODES];
>
> /* XXX someday we'll need better accounting */
> -static struct socket *o2net_listen_sock = NULL;
> +static struct socket *o2net_listen_sock;
>
> /*
> * listen work is only queued by the listening socket callbacks on the
> diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
> index e33cd7a..18f13c2 100644
> --- a/fs/ocfs2/dlm/dlmdebug.c
> +++ b/fs/ocfs2/dlm/dlmdebug.c
> @@ -338,7 +338,7 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle)
>
> #ifdef CONFIG_DEBUG_FS
>
> -static struct dentry *dlm_debugfs_root = NULL;
> +static struct dentry *dlm_debugfs_root;
>
> #define DLM_DEBUGFS_DIR "o2dlm"
> #define DLM_DEBUGFS_DLM_STATE "dlm_state"
> diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
> index 5d32f75..66c2a49 100644
> --- a/fs/ocfs2/dlm/dlmlock.c
> +++ b/fs/ocfs2/dlm/dlmlock.c
> @@ -52,7 +52,7 @@
> #define MLOG_MASK_PREFIX ML_DLM
> #include "cluster/masklog.h"
>
> -static struct kmem_cache *dlm_lock_cache = NULL;
> +static struct kmem_cache *dlm_lock_cache;
>
> static DEFINE_SPINLOCK(dlm_cookie_lock);
> static u64 dlm_next_cookie = 1;
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index af3f7aa..fd07ef9 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -82,9 +82,9 @@ static inline int dlm_mle_equal(struct dlm_ctxt *dlm,
> return 1;
> }
>
> -static struct kmem_cache *dlm_lockres_cache = NULL;
> -static struct kmem_cache *dlm_lockname_cache = NULL;
> -static struct kmem_cache *dlm_mle_cache = NULL;
> +static struct kmem_cache *dlm_lockres_cache;
> +static struct kmem_cache *dlm_lockname_cache;
> +static struct kmem_cache *dlm_mle_cache;
>
> static void dlm_mle_release(struct kref *kref);
> static void dlm_init_mle(struct dlm_master_list_entry *mle,
> diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
> index 83f1a66..5d965e8 100644
> --- a/fs/ocfs2/stackglue.c
> +++ b/fs/ocfs2/stackglue.c
> @@ -709,7 +709,7 @@ static struct ctl_table ocfs2_root_table[] = {
> { }
> };
>
> -static struct ctl_table_header *ocfs2_table_header = NULL;
> +static struct ctl_table_header *ocfs2_table_header;
>
>
> /*
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index a7cdd56..9027729 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -75,7 +75,7 @@
>
> #include "buffer_head_io.h"
>
> -static struct kmem_cache *ocfs2_inode_cachep = NULL;
> +static struct kmem_cache *ocfs2_inode_cachep;
> struct kmem_cache *ocfs2_dquot_cachep;
> struct kmem_cache *ocfs2_qf_chunk_cachep;
>
> @@ -85,7 +85,7 @@ struct kmem_cache *ocfs2_qf_chunk_cachep;
> * workqueue and schedule on our own. */
> struct workqueue_struct *ocfs2_wq = NULL;
>
> -static struct dentry *ocfs2_debugfs_root = NULL;
> +static struct dentry *ocfs2_debugfs_root;
>
> MODULE_AUTHOR("Oracle");
> MODULE_LICENSE("GPL");
> diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
> index 52eaf33..82e17b0 100644
> --- a/fs/ocfs2/uptodate.c
> +++ b/fs/ocfs2/uptodate.c
> @@ -67,7 +67,7 @@ struct ocfs2_meta_cache_item {
> sector_t c_block;
> };
>
> -static struct kmem_cache *ocfs2_uptodate_cachep = NULL;
> +static struct kmem_cache *ocfs2_uptodate_cachep;
>
> u64 ocfs2_metadata_cache_owner(struct ocfs2_caching_info *ci)
> {
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
@ 2014-04-09 0:53 ` Wengang
0 siblings, 0 replies; 8+ messages in thread
From: Wengang @ 2014-04-09 0:53 UTC (permalink / raw)
To: Fabian Frederick, linux-kernel; +Cc: ocfs2-devel
Hi Fabian,
What's the badness if we do the assignments?
thanks,
wengang
? 2014?04?09? 04:13, Fabian Frederick ??:
> static values are automatically initialized to NULL.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: ocfs2-devel at oss.oracle.com
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> fs/ocfs2/cluster/tcp.c | 2 +-
> fs/ocfs2/dlm/dlmdebug.c | 2 +-
> fs/ocfs2/dlm/dlmlock.c | 2 +-
> fs/ocfs2/dlm/dlmmaster.c | 6 +++---
> fs/ocfs2/stackglue.c | 2 +-
> fs/ocfs2/super.c | 4 ++--
> fs/ocfs2/uptodate.c | 2 +-
> 7 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
> index eb649d2..161fb1e 100644
> --- a/fs/ocfs2/cluster/tcp.c
> +++ b/fs/ocfs2/cluster/tcp.c
> @@ -108,7 +108,7 @@ static struct rb_root o2net_handler_tree = RB_ROOT;
> static struct o2net_node o2net_nodes[O2NM_MAX_NODES];
>
> /* XXX someday we'll need better accounting */
> -static struct socket *o2net_listen_sock = NULL;
> +static struct socket *o2net_listen_sock;
>
> /*
> * listen work is only queued by the listening socket callbacks on the
> diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
> index e33cd7a..18f13c2 100644
> --- a/fs/ocfs2/dlm/dlmdebug.c
> +++ b/fs/ocfs2/dlm/dlmdebug.c
> @@ -338,7 +338,7 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle)
>
> #ifdef CONFIG_DEBUG_FS
>
> -static struct dentry *dlm_debugfs_root = NULL;
> +static struct dentry *dlm_debugfs_root;
>
> #define DLM_DEBUGFS_DIR "o2dlm"
> #define DLM_DEBUGFS_DLM_STATE "dlm_state"
> diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
> index 5d32f75..66c2a49 100644
> --- a/fs/ocfs2/dlm/dlmlock.c
> +++ b/fs/ocfs2/dlm/dlmlock.c
> @@ -52,7 +52,7 @@
> #define MLOG_MASK_PREFIX ML_DLM
> #include "cluster/masklog.h"
>
> -static struct kmem_cache *dlm_lock_cache = NULL;
> +static struct kmem_cache *dlm_lock_cache;
>
> static DEFINE_SPINLOCK(dlm_cookie_lock);
> static u64 dlm_next_cookie = 1;
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index af3f7aa..fd07ef9 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -82,9 +82,9 @@ static inline int dlm_mle_equal(struct dlm_ctxt *dlm,
> return 1;
> }
>
> -static struct kmem_cache *dlm_lockres_cache = NULL;
> -static struct kmem_cache *dlm_lockname_cache = NULL;
> -static struct kmem_cache *dlm_mle_cache = NULL;
> +static struct kmem_cache *dlm_lockres_cache;
> +static struct kmem_cache *dlm_lockname_cache;
> +static struct kmem_cache *dlm_mle_cache;
>
> static void dlm_mle_release(struct kref *kref);
> static void dlm_init_mle(struct dlm_master_list_entry *mle,
> diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
> index 83f1a66..5d965e8 100644
> --- a/fs/ocfs2/stackglue.c
> +++ b/fs/ocfs2/stackglue.c
> @@ -709,7 +709,7 @@ static struct ctl_table ocfs2_root_table[] = {
> { }
> };
>
> -static struct ctl_table_header *ocfs2_table_header = NULL;
> +static struct ctl_table_header *ocfs2_table_header;
>
>
> /*
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index a7cdd56..9027729 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -75,7 +75,7 @@
>
> #include "buffer_head_io.h"
>
> -static struct kmem_cache *ocfs2_inode_cachep = NULL;
> +static struct kmem_cache *ocfs2_inode_cachep;
> struct kmem_cache *ocfs2_dquot_cachep;
> struct kmem_cache *ocfs2_qf_chunk_cachep;
>
> @@ -85,7 +85,7 @@ struct kmem_cache *ocfs2_qf_chunk_cachep;
> * workqueue and schedule on our own. */
> struct workqueue_struct *ocfs2_wq = NULL;
>
> -static struct dentry *ocfs2_debugfs_root = NULL;
> +static struct dentry *ocfs2_debugfs_root;
>
> MODULE_AUTHOR("Oracle");
> MODULE_LICENSE("GPL");
> diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
> index 52eaf33..82e17b0 100644
> --- a/fs/ocfs2/uptodate.c
> +++ b/fs/ocfs2/uptodate.c
> @@ -67,7 +67,7 @@ struct ocfs2_meta_cache_item {
> sector_t c_block;
> };
>
> -static struct kmem_cache *ocfs2_uptodate_cachep = NULL;
> +static struct kmem_cache *ocfs2_uptodate_cachep;
>
> u64 ocfs2_metadata_cache_owner(struct ocfs2_caching_info *ci)
> {
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
2014-04-09 0:53 ` Wengang
@ 2014-04-09 4:22 ` Fabian Frederick
-1 siblings, 0 replies; 8+ messages in thread
From: Fabian Frederick @ 2014-04-09 4:22 UTC (permalink / raw)
To: Wengang; +Cc: linux-kernel, ocfs2-devel
On Wed, 09 Apr 2014 08:53:14 +0800
Wengang <wen.gang.wang@oracle.com> wrote:
> Hi Fabian,
>
> What's the badness if we do the assignments?
>
> thanks,
> wengang
Hi Wengang,
Nothing wrong but AFAICS redundant.
Regards,
Fabian
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
@ 2014-04-09 4:22 ` Fabian Frederick
0 siblings, 0 replies; 8+ messages in thread
From: Fabian Frederick @ 2014-04-09 4:22 UTC (permalink / raw)
To: Wengang; +Cc: linux-kernel, ocfs2-devel
On Wed, 09 Apr 2014 08:53:14 +0800
Wengang <wen.gang.wang@oracle.com> wrote:
> Hi Fabian,
>
> What's the badness if we do the assignments?
>
> thanks,
> wengang
Hi Wengang,
Nothing wrong but AFAICS redundant.
Regards,
Fabian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
2014-04-09 0:53 ` Wengang
@ 2014-04-09 20:44 ` Andrew Morton
-1 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2014-04-09 20:44 UTC (permalink / raw)
To: Wengang; +Cc: Fabian Frederick, linux-kernel, ocfs2-devel
On Wed, 09 Apr 2014 08:53:14 +0800 Wengang <wen.gang.wang@oracle.com> wrote:
> ___ 2014___04___09___ 04:13, Fabian Frederick ______:
> > static values are automatically initialized to NULL.
> >
>
> What's the badness if we do the assignments?
(top-posting repaired...)
Back in the olden days,
static int x = 0;
would consume space in the .data segment and
static int x;
would consume space in the .bss segment.
The .data segment is a part of vmlinux (because it contains non-zero
data) whereas .bss does not occupy space in vmlinux because .bss is
all-zero and can be built at runtime
So the effect of this patch would be to reduce the size of the kernel
image. Less disk space, less ROM space, etc.
I think more recent gcc's and linkers got smarter about that and move
initialized-to-zero .data into .bss anyway.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
@ 2014-04-09 20:44 ` Andrew Morton
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2014-04-09 20:44 UTC (permalink / raw)
To: Wengang; +Cc: Fabian Frederick, linux-kernel, ocfs2-devel
On Wed, 09 Apr 2014 08:53:14 +0800 Wengang <wen.gang.wang@oracle.com> wrote:
> ___ 2014___04___09___ 04:13, Fabian Frederick ______:
> > static values are automatically initialized to NULL.
> >
>
> What's the badness if we do the assignments?
(top-posting repaired...)
Back in the olden days,
static int x = 0;
would consume space in the .data segment and
static int x;
would consume space in the .bss segment.
The .data segment is a part of vmlinux (because it contains non-zero
data) whereas .bss does not occupy space in vmlinux because .bss is
all-zero and can be built at runtime
So the effect of this patch would be to reduce the size of the kernel
image. Less disk space, less ROM space, etc.
I think more recent gcc's and linkers got smarter about that and move
initialized-to-zero .data into .bss anyway.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-04-09 20:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-08 20:13 [PATCH 1/1] OCFS2: Remove NULL assignments on static Fabian Frederick
2014-04-08 20:13 ` [Ocfs2-devel] " Fabian Frederick
2014-04-09 0:53 ` Wengang
2014-04-09 0:53 ` Wengang
2014-04-09 4:22 ` Fabian Frederick
2014-04-09 4:22 ` Fabian Frederick
2014-04-09 20:44 ` Andrew Morton
2014-04-09 20:44 ` Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.