Skip to contentSkip to conversation

kernel: pid_namespace : fix warning Using plain integer as NULL pointer

PATCH In review Hariprasad Kelam 2 participants 2 messages Apr 6, 2019 Namespaces:

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel: pid_namespace : fix warning Using plain integer as NULL pointer

changed passing function argument "0 to NULL" to fix below sparse warning

kernel/pid_namespace.c:55:76: warning: Using plain integer as NULL pointer

did changes to avoid checkpatch error "prefer a maximum 75 chars per line"

---
 kernel/pid_namespace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/pid_namespace.c +2 -1
index aa6e72f..6e4afdc 100644
@@ -52,7 +52,8 @@ static struct kmem_cache *create_pid_cachep(unsigned int level)
 	mutex_lock(&pid_caches_mutex);
 	/* Name collision forces to do allocation under mutex. */
 	if (!*pkc)
-		*pkc = kmem_cache_create(name, len, 0, SLAB_HWCACHE_ALIGN, 0);
+		*pkc =
+		    kmem_cache_create(name, len, 0, SLAB_HWCACHE_ALIGN, NULL);
 	mutex_unlock(&pid_caches_mutex);
 	/* current can fail, but someone else can succeed. */
 	return READ_ONCE(*pkc);
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Hariprasad Kelam

changed passing function argument "0 to NULL" to fix below sparse warning

kernel/pid_namespace.c:55:76: warning: Using plain integer as NULL pointer

did changes to avoid checkpatch error "prefer a maximum 75 chars per line"

Cheers,
-Mukesh

Quoted 18 lines
---
  kernel/pid_namespace.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
kernel/pid_namespace.c +2 -1
index aa6e72f..6e4afdc 100644
@@ -52,7 +52,8 @@ static struct kmem_cache *create_pid_cachep(unsigned int level)
  	mutex_lock(&pid_caches_mutex);
  	/* Name collision forces to do allocation under mutex. */
  	if (!*pkc)
-		*pkc = kmem_cache_create(name, len, 0, SLAB_HWCACHE_ALIGN, 0);
+		*pkc =
+		    kmem_cache_create(name, len, 0, SLAB_HWCACHE_ALIGN, NULL);
  	mutex_unlock(&pid_caches_mutex);
  	/* current can fail, but someone else can succeed. */
  	return READ_ONCE(*pkc);