Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932294AbbBID0s (ORCPT ); Sun, 8 Feb 2015 22:26:48 -0500 Received: from mail-bn1bon0110.outbound.protection.outlook.com ([157.56.111.110]:58907 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932266AbbBID0q (ORCPT ); Sun, 8 Feb 2015 22:26:46 -0500 Date: Mon, 9 Feb 2015 10:15:19 +0800 From: Peter Chen To: Bas Peters CC: , , , , , , Subject: Re: [PATCH 1/6] drivers: usb: core: devio.c: remove assignment of variables in if conditions. Message-ID: <20150209021518.GC3045@shlinux2> References: <1423346106-13493-1-git-send-email-baspeters93@gmail.com> <1423346106-13493-2-git-send-email-baspeters93@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1423346106-13493-2-git-send-email-baspeters93@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=peter.chen@freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(24454002)(51704005)(92566002)(19580395003)(19580405001)(77096005)(6806004)(97756001)(46102003)(85426001)(50466002)(87936001)(23726002)(33656002)(104016003)(1411001)(86362001)(83506001)(50986999)(62966003)(76176999)(54356999)(77156002)(46406003)(106466001)(47776003)(33716001)(105606002)(2950100001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR03MB335;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB335; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:DM2PR03MB335; X-Forefront-PRVS: 04825EA361 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB335; X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2015 03:26:42.4545 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB335 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2662 Lines: 79 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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/