Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1039234imu; Wed, 23 Jan 2019 09:46:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mbeCPcujZyjURgpa51a1iU8I1tiQewcaVns5j46xAtba3DpVaNDQlOhO2LLR914rHsVFG X-Received: by 2002:a65:6542:: with SMTP id a2mr2740518pgw.389.1548265606746; Wed, 23 Jan 2019 09:46:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548265606; cv=none; d=google.com; s=arc-20160816; b=far6JSdbXWH/bgd6aHu3fsftpiTDcGQhEznxEITcCxMqUZZ6o2mDyNt99zP5iky9km fgGdvb/mGqJZ7RNXxc2o5XRYQMgqjXFz6S3JqQxaVDnzu/9l0JHDqEyqokWBdn2X5JTc ZrSAiwrr75BrFuVYOipg81eNmkGWuZkHhSXjyJg6xlThihHGG2aS4c0h8HDNBKoP/282 SyfDcB/3d2LTDKFmaPgKpHdSGxptV8JVwl3A7yGs35okH5X34uh3xrAcyMireendZx8Q OyjblUHNilcb1QBjrWmRA0+ejIk7qDCmLXDDGa4a3QQVIrMGhLsfKp8qABtn6Y+9XdEF Z8fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=P7Y3As41ItXTSh9IhsUboLFA/PSw+/vQEIL2ILKpA4c=; b=gSXcEemcejykOyWOV0P+EECdRG5YfO2JwLg+58jUeIJoobzFrSSwufYCUtlgM4hJ4R glm/FxOiyuP2LZ+yLVxZg2pqr0ielPY6XX8pD6LMXO4Zy8CCbEVpbfta2tBYjueb0AMP Vqv3TLe8ydVEqjPMQUUFBNRdc6XvPaU90COecTWkzIus5k9L4EEtlPlQMBTOR8fcO4JJ WHzgWPnyeVosVRs9qoCAtUECGlz0lSkTo429b1GM/1uShsotpzbXx/7/f+GPCPztfZeT V4sP9BbJPho3Dx1FOOn/28KagLuGKX61sxh0DWvSuMDyr9Nxg/6aHzq74+RMaOlrKbJ2 bWHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y188si8915632pfb.59.2019.01.23.09.46.30; Wed, 23 Jan 2019 09:46:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726252AbfAWRp7 (ORCPT + 99 others); Wed, 23 Jan 2019 12:45:59 -0500 Received: from smtprelay0119.hostedemail.com ([216.40.44.119]:39024 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726038AbfAWRp6 (ORCPT ); Wed, 23 Jan 2019 12:45:58 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 0AA4A1803BBD2; Wed, 23 Jan 2019 17:45:57 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2898:2899:3138:3139:3140:3141:3142:3353:3622:3865:3866:3868:3871:3872:4321:5007:7514:7903:10004:10400:10848:11026:11232:11658:11914:12043:12296:12438:12555:12712:12737:12740:12760:12895:12986:13439:14181:14659:14721:21080:21324:21451:21627:30012:30029:30054:30070:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:28,LUA_SUMMARY:none X-HE-Tag: hook98_50c7cd4ae7c16 X-Filterd-Recvd-Size: 3265 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Wed, 23 Jan 2019 17:45:54 +0000 (UTC) Message-ID: Subject: Re: [PATCH] staging: mt7621-pinctrl: Remove space after cast From: Joe Perches To: Nishad Kamdar , Greg Kroah-Hartman Cc: NeilBrown , Matthias Brugger , Sergio Paracuellos , Kees Cook , John Crispin , devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 23 Jan 2019 09:45:53 -0800 In-Reply-To: <20190123163122.GA4807@nishad> References: <20190123163122.GA4807@nishad> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-01-23 at 22:01 +0530, Nishad Kamdar wrote: > This patch removes space after a cast as it > is not needed. > Issue found by checkpatch. > > Signed-off-by: Nishad Kamdar > --- > drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c > index 80e7067cfb79..3e959fa73703 100644 > --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c > +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c > @@ -363,7 +363,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) > } > > range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL); > - range->name = name = (char *) &range[1]; > + range->name = name = (char *)&range[1]; > sprintf(name, "pio"); I find this code unsightly and fragile. It doesn't test the return of devm_kzalloc for failure. This might as well be --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 80e7067cfb79..9b52d44abef1 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -350,7 +350,6 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) for_each_compatible_node(np, NULL, "ralink,rt2880-gpio") { const __be32 *ngpio, *gpiobase; struct pinctrl_gpio_range *range; - char *name; if (!of_device_is_available(np)) continue; @@ -362,9 +361,10 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) return -EINVAL; } - range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL); - range->name = name = (char *) &range[1]; - sprintf(name, "pio"); + range = devm_kzalloc(p->dev, sizeof(*range), GFP_KERNEL); + if (!range) + return -ENOMEM; + range->name = "pio"; range->npins = __be32_to_cpu(*ngpio); range->base = __be32_to_cpu(*gpiobase); range->pin_base = range->base;