All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ruan Jinjie <ruanjinjie@huawei.com>
To: <peter.chen@kernel.org>, <gregkh@linuxfoundation.org>,
	<leoyang.li@nxp.com>, <b-liu@ti.com>,
	<valentina.manea.m@gmail.com>, <shuah@kernel.org>,
	<i@zenithal.me>, <stern@rowland.harvard.edu>,
	<u.kleine-koenig@pengutronix.de>, <aaro.koskinen@iki.fi>,
	<void0red@gmail.com>, <linux-usb@vger.kernel.org>,
	<linuxppc-dev@lists.ozlabs.org>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH -next 5/5] USB: usbip: Remove an unnecessary NULL value
Date: Fri, 4 Aug 2023 17:32:53 +0800	[thread overview]
Message-ID: <20230804093253.91647-6-ruanjinjie@huawei.com> (raw)
In-Reply-To: <20230804093253.91647-1-ruanjinjie@huawei.com>

The NULL initialization of the pointers assigned by kzalloc() first is
not necessary, because if the kzalloc() failed, the pointers will be
assigned NULL, otherwise it works as usual. so remove it.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/usb/usbip/vudc_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c
index 2bc428f2e261..8e42839e6060 100644
--- a/drivers/usb/usbip/vudc_dev.c
+++ b/drivers/usb/usbip/vudc_dev.c
@@ -489,7 +489,7 @@ static void vudc_device_unusable(struct usbip_device *ud)
 
 struct vudc_device *alloc_vudc_device(int devid)
 {
-	struct vudc_device *udc_dev = NULL;
+	struct vudc_device *udc_dev;
 
 	udc_dev = kzalloc(sizeof(*udc_dev), GFP_KERNEL);
 	if (!udc_dev)
-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Ruan Jinjie <ruanjinjie@huawei.com>
To: <peter.chen@kernel.org>, <gregkh@linuxfoundation.org>,
	<leoyang.li@nxp.com>, <b-liu@ti.com>,
	<valentina.manea.m@gmail.com>, <shuah@kernel.org>,
	<i@zenithal.me>, <stern@rowland.harvard.edu>,
	<u.kleine-koenig@pengutronix.de>, <aaro.koskinen@iki.fi>,
	<void0red@gmail.com>, <linux-usb@vger.kernel.org>,
	<linuxppc-dev@lists.ozlabs.org>
Cc: ruanjinjie@huawei.com
Subject: [PATCH -next 5/5] USB: usbip: Remove an unnecessary NULL value
Date: Fri, 4 Aug 2023 17:32:53 +0800	[thread overview]
Message-ID: <20230804093253.91647-6-ruanjinjie@huawei.com> (raw)
In-Reply-To: <20230804093253.91647-1-ruanjinjie@huawei.com>

The NULL initialization of the pointers assigned by kzalloc() first is
not necessary, because if the kzalloc() failed, the pointers will be
assigned NULL, otherwise it works as usual. so remove it.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/usb/usbip/vudc_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c
index 2bc428f2e261..8e42839e6060 100644
--- a/drivers/usb/usbip/vudc_dev.c
+++ b/drivers/usb/usbip/vudc_dev.c
@@ -489,7 +489,7 @@ static void vudc_device_unusable(struct usbip_device *ud)
 
 struct vudc_device *alloc_vudc_device(int devid)
 {
-	struct vudc_device *udc_dev = NULL;
+	struct vudc_device *udc_dev;
 
 	udc_dev = kzalloc(sizeof(*udc_dev), GFP_KERNEL);
 	if (!udc_dev)
-- 
2.34.1


  parent reply	other threads:[~2023-08-04  9:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  9:32 [PATCH -next 0/5] usb: Remove many unnecessary NULL values Ruan Jinjie
2023-08-04  9:32 ` Ruan Jinjie
2023-08-04  9:32 ` [PATCH -next 1/5] usb: gadget: udc: Remove " Ruan Jinjie
2023-08-04  9:32   ` Ruan Jinjie
2023-08-04  9:32 ` [PATCH -next 2/5] USB: misc: " Ruan Jinjie
2023-08-04  9:32   ` Ruan Jinjie
2023-08-04  9:32 ` [PATCH -next 3/5] usb: chipidea: udc: Remove an unnecessary NULL value Ruan Jinjie
2023-08-04  9:32   ` Ruan Jinjie
2023-08-04  9:32 ` [PATCH -next 4/5] usb: musb: " Ruan Jinjie
2023-08-04  9:32   ` Ruan Jinjie
2023-08-04  9:32 ` Ruan Jinjie [this message]
2023-08-04  9:32   ` [PATCH -next 5/5] USB: usbip: " Ruan Jinjie
2023-08-04 20:09   ` shuah
2023-08-05  2:46     ` Ruan Jinjie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230804093253.91647-6-ruanjinjie@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=i@zenithal.me \
    --cc=leoyang.li@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=peter.chen@kernel.org \
    --cc=shuah@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=valentina.manea.m@gmail.com \
    --cc=void0red@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.