public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@freescale.com>
To: Bas Peters <baspeters93@gmail.com>
Cc: <gregkh@linuxgoundation.org>, <stern@rowland.harvard.edu>,
	<dan.j.williams@intel.com>, <hdegoede@redhat.com>,
	<sarah.a.sharp@linux.intel.com>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] drivers: usb: core: devio.c: remove assignment of variables in if conditions.
Date: Mon, 9 Feb 2015 10:15:19 +0800	[thread overview]
Message-ID: <20150209021518.GC3045@shlinux2> (raw)
In-Reply-To: <1423346106-13493-2-git-send-email-baspeters93@gmail.com>

On Sat, Feb 07, 2015 at 10:55:01PM +0100, Bas Peters wrote:
> This patch removes assignment of variables in if conditions in
> accordance witht the CodingStyle.

%s/witht/with

> 
> Signed-off-by: Bas Peters <baspeters93@gmail.com>
> ---
>  drivers/usb/core/devio.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> index 0b59731..ea3c737 100644
> --- a/drivers/usb/core/devio.c
> +++ b/drivers/usb/core/devio.c
> @@ -1081,7 +1081,8 @@ static int proc_bulk(struct usb_dev_state *ps, void __user *arg)
>  	ret = usbfs_increase_memory_usage(len1 + sizeof(struct urb));
>  	if (ret)
>  		return ret;
> -	if (!(tbuf = kmalloc(len1, GFP_KERNEL))) {
> +	tbuf = kmalloc(len1, GFP_KERNEL);
> +	if (!tbuf) {
>  		ret = -ENOMEM;
>  		goto done;
>  	}
> @@ -1223,7 +1224,8 @@ static int proc_setintf(struct usb_dev_state *ps, void __user *arg)
>  
>  	if (copy_from_user(&setintf, arg, sizeof(setintf)))
>  		return -EFAULT;
> -	if ((ret = checkintf(ps, setintf.interface)))
> +	ret = checkintf(ps, setintf.interface);
> +	if (ret)
>  		return ret;
>  
>  	destroy_async_on_interface(ps, setintf.interface);
> @@ -1392,7 +1394,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
>  		number_of_packets = uurb->number_of_packets;
>  		isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) *
>  				   number_of_packets;
> -		if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL)))
> +		isopkt = kmalloc(isofrmlen, GFP_KERNEL);
> +		if (!isopkt)
>  			return -ENOMEM;
>  		if (copy_from_user(isopkt, iso_frame_desc, isofrmlen)) {
>  			ret = -EFAULT;
> @@ -1901,7 +1904,8 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg)
>  
>  	if (get_user(ifnum, (unsigned int __user *)arg))
>  		return -EFAULT;
> -	if ((ret = releaseintf(ps, ifnum)) < 0)
> +	ret = releaseintf(ps, ifnum);
> +	if (ret < 0)
>  		return ret;
>  	destroy_async_on_interface (ps, ifnum);
>  	return 0;
> @@ -1916,7 +1920,8 @@ static int proc_ioctl(struct usb_dev_state *ps, struct usbdevfs_ioctl *ctl)
>  	struct usb_driver       *driver = NULL;
>  
>  	/* alloc buffer */
> -	if ((size = _IOC_SIZE(ctl->ioctl_code)) > 0) {
> +	size = _IOC_SIZE(ctl->ioctl_code);
> +	if (size > 0) {
>  		buf = kmalloc(size, GFP_KERNEL);
>  		if (buf == NULL)
>  			return -ENOMEM;
> -- 
> 2.1.0
> 

-- 

Best Regards,
Peter Chen

  reply	other threads:[~2015-02-09  3:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-07 21:55 [PATCH 0/6] drivers: usb: core: fix various checkpatch errors Bas Peters
2015-02-07 21:55 ` [PATCH 1/6] drivers: usb: core: devio.c: remove assignment of variables in if conditions Bas Peters
2015-02-09  2:15   ` Peter Chen [this message]
2015-02-09 10:05     ` Bas Peters
2015-02-07 21:55 ` [PATCH 2/6] drivers: usb: core: devio.c: fix whitespace errors thrown by checkpatch.pl Bas Peters
2015-02-07 21:55 ` [PATCH 3/6] drivers: usb: core: hcd.c: remove assignment of variables in if conditions Bas Peters
2015-02-08 11:15   ` Sergei Shtylyov
2015-02-09 10:10     ` Bas Peters
2015-02-07 21:55 ` [PATCH 4/6] drivers: usb: core: hub.c: remove NULL initialization of static variables Bas Peters
2015-02-08 11:17   ` Sergei Shtylyov
2015-02-07 21:55 ` [PATCH 5/6] drivers: usb: core: hub.c: remove assignment of variables in if conditions Bas Peters
2015-02-08 11:20   ` Sergei Shtylyov
2015-02-07 21:55 ` [PATCH 6/6] drivers: usb: core: endpoint.c: fix trivial whitespace issue Bas Peters

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=20150209021518.GC3045@shlinux2 \
    --to=peter.chen@freescale.com \
    --cc=baspeters93@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxgoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    /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