Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp576406imu; Fri, 25 Jan 2019 07:18:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN5vCW67wi5UzGFwGzj45DjvdpqWl6QRGJoW058HOr2QHQqPnfUr7ZaP92CJz2Fw0S27FNqM X-Received: by 2002:a63:9a09:: with SMTP id o9mr9917080pge.94.1548429517363; Fri, 25 Jan 2019 07:18:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548429517; cv=none; d=google.com; s=arc-20160816; b=09DsqWpEm52/NMW5IASWid1SNiXhCLJHCD6VvvZxoLsLl27ENWxsQNauZXtMu+/br5 tHXAbGqzv3SSpG2dxulMrPIGFQYkrSJBkRrxJrjt2GUAHhGyerBtr4axFfoRu6X5DHa1 vwfiR3y5x+i2V79DKSqlxKyUEg7mfhMclt9o32kIhvgAYFazYkP+Q9xl3I24tAheSYZm vlMVLEVgfcKWHyww9kktLFdi/ak3x/pOxFhtgb/okNkyYV+LyfmM4okpCAOnBqdWv/ga gHL7XxPS0hnumdnxzvryvNhYeJABxErZDb5z9yu85rAXVwNNaOqRjSGMoVhvzEc/6MDQ Xpgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CQyVqyjAD0UyM5BgevkTZgjLaebiRunzdWd/bduHnnQ=; b=juprkyDSYcXf3kdDGxJMP5JBfUOKDD10pFbVaQcnOxrk5/48lLKiJ7Ma5cMu/y+yYg YX7tXyGWPaE+BS9g+9K1nwVEDadJNBK7CSe/SN2tSPGBXpA/uzEfHVZSH4ESXQejUBkc cI3KWnNSTD9n9J9zDQcFH+STSQyUsX8ZHNHI8RYOMvnGWGnbwMmWk0HnvcDDQiDYNIIP yvuN0SrfsAfhWWriRwf+gcckZ/4lCWgy1GptdnHYCwySO1uSKmb1mht1B7QRDPy926JD UugJbNV5eR+UcRWA2asqjRwpltqnEOTP3OE8vNgJpUp0j1b4SoOtOTF+T1tXOXnTPcFR 7Hxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jtKXMVLX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si26577544pln.128.2019.01.25.07.18.21; Fri, 25 Jan 2019 07:18:37 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jtKXMVLX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbfAYPSE (ORCPT + 99 others); Fri, 25 Jan 2019 10:18:04 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:39827 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbfAYPSE (ORCPT ); Fri, 25 Jan 2019 10:18:04 -0500 Received: by mail-pl1-f193.google.com with SMTP id 101so4696087pld.6 for ; Fri, 25 Jan 2019 07:18:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CQyVqyjAD0UyM5BgevkTZgjLaebiRunzdWd/bduHnnQ=; b=jtKXMVLXW2qJn51/uL/ymU0bcO1tV1zzF0r35YxSHcGlgNr1UKbE/mMoc1ztI+ABfP 3QJQEbbwia0I7MO5AyOkoOZGX3GBHrLW+h4ZnxIKhUaQ6S8NeKfj7mGFtg90ZmRV9+zG 1S005em1c9gjLWh+oR1FNNo0w2TbzemyhiBGBfGn4r8YZIyc9bpM5ChMBQF5OReokd8/ VHZW3jQCPnuRBfhHq8yoE51DOl9FotuhP+hQfHn86vRlDw+y1JuFz2SMtoU2BJzV2jnU QxAuc6ecdXLmQ/gJBEvC0TQdkYNMevEeIfbN7nKN+nBg4bywqzvT1hDhKJORYG2f6ngP 7Wqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CQyVqyjAD0UyM5BgevkTZgjLaebiRunzdWd/bduHnnQ=; b=dEg5Kyi5oe/LASP0OV1HAr/eIcY0Z40lI9gRqxHZRAvl9Rs3JUrGcXaH5XBFv7cPwl CvUZIte5A51US7WD2zzm+MTOCvdX6+5XKygJg91qA1uF89zvQr+ahxok7yrsMo+qYGRP eRqrssFPxE7GxqNgPfEO6u8LZ/5xTs+VSC0hQhtxHziaTb9Td7azFj8P4n0nXWDqXVab VJx/WTyjh6k1XZ1rsuROqZWsTlaDEQyOo3WB74mm0z/Ps74ZVK7e/XX4+Lhby22bwOhV WT+7kitbG5Pa7DMSI89d4AkIPjdb2IVzFLWr+QESt0bMwVBZqZScM8OvYEMiGSiGRxLT 3n4g== X-Gm-Message-State: AJcUukcJwNeFBYLyI9sQm54LnAo4P3i1dI/GJUw+5lk6grLTM3tprNQu kjZLSSZX7oJ2UUMSuobur9I= X-Received: by 2002:a17:902:bb98:: with SMTP id m24mr11072502pls.71.1548429483040; Fri, 25 Jan 2019 07:18:03 -0800 (PST) Received: from nishad ([106.51.25.107]) by smtp.gmail.com with ESMTPSA id b10sm36543837pfj.183.2019.01.25.07.17.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 07:18:02 -0800 (PST) Date: Fri, 25 Jan 2019 20:47:53 +0530 From: Nishad Kamdar To: Joe Perches 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, Greg Kroah-Hartman Subject: Re: [PATCH] staging: mt7621-pinctrl: Remove space after cast Message-ID: <20190125151751.GA11257@nishad> References: <20190123163122.GA4807@nishad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 23, 2019 at 09:45:53AM -0800, Joe Perches wrote: > 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; > > > Ok, I'll include it as a new patch as I think this one has already been accepted. Thanks for the review. Regards, Nishad