kernel: relay: remove unnecessary NULL values from relay_open_buf
authorLi kunyu <kunyu@nfschina.com>
Thu, 13 Jul 2023 23:44:59 +0000 (07:44 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Aug 2023 17:18:55 +0000 (10:18 -0700)
buf is assigned first, so it does not need to initialize the assignment.

Link: https://lkml.kernel.org/r/20230713234459.2908-1-kunyu@nfschina.com
Signed-off-by: Li kunyu <kunyu@nfschina.com>
Reviewed-by: Andrew Morton <akpm@linux-foudation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/relay.c

index a80fa01..83fe032 100644 (file)
@@ -375,7 +375,7 @@ static struct dentry *relay_create_buf_file(struct rchan *chan,
  */
 static struct rchan_buf *relay_open_buf(struct rchan *chan, unsigned int cpu)
 {
-       struct rchan_buf *buf = NULL;
+       struct rchan_buf *buf;
        struct dentry *dentry;
 
        if (chan->is_global)