linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Colin Ian King <colin.king@canonical.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: usb: mtu3: Checking initialisation of the variable “mep” in two functions
Date: Mon, 29 Jun 2020 09:48:13 +0800	[thread overview]
Message-ID: <1593395293.3798.3.camel@mhfsdcap03> (raw)
In-Reply-To: <8efdb7aa-1188-e94a-3075-ab1dd30768bb@web.de>

Hi,
On Sat, 2020-06-27 at 14:28 +0200, Markus Elfring wrote:
> Hello,
> 
> A source code analysis approach by the means of the semantic patch language
> (Coccinelle software) pointed an implementation detail out for further
> development considerations.
> 
> The functions “mtu3_gadget_ep_set_halt” and “mtu3_gadget_ep_set_wedge” check
> at the beginning if the input parameter “ep” is a null pointer.
> The error code “-EINVAL” will be returned then.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/mtu3/mtu3_gadget.c?id=1590a2e1c681b0991bd42c992cabfd380e0338f2#n371
> https://elixir.bootlin.com/linux/v5.7.2/source/drivers/usb/mtu3/mtu3_gadget.c#L371
> 
> Can it be nicer to assign the variable “mep” only after a successful check
> instead of an initialisation before?
Yes, I'll fix it, thanks a lot

> 
> Regards,
> Markus

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

      reply	other threads:[~2020-06-29  1:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-27 12:28 usb: mtu3: Checking initialisation of the variable “mep” in two functions Markus Elfring
2020-06-29  1:48 ` Chunfeng Yun [this message]

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=1593395293.3798.3.camel@mhfsdcap03 \
    --to=chunfeng.yun@mediatek.com \
    --cc=Markus.Elfring@web.de \
    --cc=colin.king@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.bgg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).