Received: by 10.223.176.46 with SMTP id f43csp3960491wra; Tue, 23 Jan 2018 01:51:46 -0800 (PST) X-Google-Smtp-Source: AH8x224/t4/JS/m6ZY3XjMyNfPR8yMIOvRmmBZiru0ppV4Pn6lbnnRZL+wKiFQuFE0JDWOJEOoUF X-Received: by 10.99.63.11 with SMTP id m11mr2692981pga.422.1516701105915; Tue, 23 Jan 2018 01:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516701105; cv=none; d=google.com; s=arc-20160816; b=DN352lHvSslaCzb3/pfdXB5y7s52XDLueuN3v0fTzT8z9rJBQjs3QxiKH0gOfX8Map cbEWVc2KZbd/KR0O0BeUQ44soDMATIqRviWfb69PxxcDFW2nlqYiIyQHYSX6eEBPEw43 FpjdFHuQCIbBn2TxfOD/dX6X5/ZZo7Mh8bgRfXVzbYpfLX/B7kLxHGBPS4SjkN2690Hs R+Utmj0Lf1Es8d3mtf7vie7w82lyoWwBIJ3wfZatmzD89jI7CBNhUOlK6TAuLJiW76hE iL9M21rVvKYGHVadzObnnCXr4WKadeHm68v6SBLoHN8shv8abRleWhFTHlxfjgLieNca 5slA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=512X8ygBIyWHo2ZzKDi83rkNKSP8zvQfM1Fbv94M0p0=; b=vCo+J8+paHoG1pdTRnRVpdhV3F7vLNr9Cc1YBVZxAz9DgHueqcvY1uljbZY9infZfZ HHZn/05dsQFkn/ewQ6wvUUqbazjuajSHF7S3yiPAjRtpaOTwBTECxuNAewDW6eJLHtYU idY9opk+gn6Icucek8RmrEcY8/VVSnej2MZef3Ig/kJBUq7nABPtsjRx14C4mcnCZGcV AYMceGrNnacNapU+6eS7qy2kTKT0pT5JAVwMCZYDvwB+AOBwlbFEx7tdlwQd/g9xzo+9 8Ms/xoQ2RRxljNdQ73BVG/rYandGMkEXIjx337D5t/vNgS/wKyEqm1ncAhpHwm2d658z Cfhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTDdYo1P; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si14582699pgc.754.2018.01.23.01.51.31; Tue, 23 Jan 2018 01:51:45 -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=@linaro.org header.s=google header.b=QTDdYo1P; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbeAWJvH (ORCPT + 99 others); Tue, 23 Jan 2018 04:51:07 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:39725 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbeAWJvE (ORCPT ); Tue, 23 Jan 2018 04:51:04 -0500 Received: by mail-wr0-f194.google.com with SMTP id z48so11784333wrz.6 for ; Tue, 23 Jan 2018 01:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=512X8ygBIyWHo2ZzKDi83rkNKSP8zvQfM1Fbv94M0p0=; b=QTDdYo1PVFk+SRH3a9E7H03HPxoOWLHe/VN4Fqmb7x/y8p49vYRBFw+fyyKokvFAi/ nyiHegmArn0aeTNMM/vrrMuj97g5z170uKOfseE8VCZrdHz2scJaPB37DWz5dWNBhKNk M1JgivVXZfQ0uo950eGa9FMsQ9xmVtnh/oPFc= 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:content-transfer-encoding :in-reply-to:user-agent; bh=512X8ygBIyWHo2ZzKDi83rkNKSP8zvQfM1Fbv94M0p0=; b=d/uFRDCA05zyiiNIDu50CptS4uSruCadzBmAFz4E/vZ54mmyTPfrJxWN+kSv4g13om XnXna/v4e5zQWkoD9empDun10h7KlmNgaVxfSo7D7sDlt7Vp1IuEb0AE4Ax6M4WQM+w/ Mxj7L+l3Fq/Xq82iwwSIydBuJIJ/ezYmMfcZJ8TPk3lx0/Psrk+16LIGKqcKVZhcI/hk VgUKY4omy+qhagvXXmtMMN1/yBrODzUVBuCVDKdhysjt/HOgNOPNpzUAlPtU1Bx+TJ2r ybd5VuoHgkeNSWMlfuLckbwenjWGHjPMsJJ2C8zUWVTQohIxkk7I+lMix7TUpDz7EN9u z2Xw== X-Gm-Message-State: AKwxytdZFT4uds5yjMvr5sfD1p/JQUzHTLtLEZsumu/g54OX8G2qNTHK +iXKAsRmag7toymkR32kaS/HjA== X-Received: by 10.223.131.166 with SMTP id 35mr1552725wre.221.1516701063351; Tue, 23 Jan 2018 01:51:03 -0800 (PST) Received: from dell ([2.27.167.60]) by smtp.gmail.com with ESMTPSA id t65sm7447281wmt.39.2018.01.23.01.51.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2018 01:51:01 -0800 (PST) Date: Tue, 23 Jan 2018 09:50:59 +0000 From: Lee Jones To: SF Markus Elfring Cc: kernel-janitors@vger.kernel.org, LKML Subject: Re: [PATCH 2/2] mfd: smsc-ece1099: Improve a size determination in smsc_i2c_probe() Message-ID: <20180123095059.bushkfuww6nyjvlo@dell> References: <978023d9-01f2-3a16-5eba-e06b8359cfc0@users.sourceforge.net> <721383c6-7d82-7911-989d-fb230038a52b@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <721383c6-7d82-7911-989d-fb230038a52b@users.sourceforge.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Jan 2018, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 16 Jan 2018 08:58:26 +0100 > > Replace the specification of a data structure by a pointer dereference > as the parameter for the operator "sizeof" to make the corresponding size > determination a bit safer according to the Linux coding style convention. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > drivers/mfd/smsc-ece1099.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c > index b9d96651cc0d..6681205dd2c0 100644 > --- a/drivers/mfd/smsc-ece1099.c > +++ b/drivers/mfd/smsc-ece1099.c > @@ -33,12 +33,10 @@ static const struct regmap_config smsc_regmap_config = { > static int smsc_i2c_probe(struct i2c_client *i2c, > const struct i2c_device_id *id) > { > - struct smsc *smsc; > int devid, rev, venid_l, venid_h; > int ret; > + struct smsc *smsc = devm_kzalloc(&i2c->dev, sizeof(*smsc), GFP_KERNEL); Please keep these separate. > - smsc = devm_kzalloc(&i2c->dev, sizeof(struct smsc), > - GFP_KERNEL); > if (!smsc) > return -ENOMEM; > -- Lee Jones Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog