Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp549836imm; Tue, 5 Jun 2018 00:00:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKIH2yPDXPqzbeqyi/58H8EQ+rBPpeje0xi2ld2Q9TWpNPghOOOyj2RS6g7e0CCa0+YpSFp X-Received: by 2002:a17:902:b81:: with SMTP id 1-v6mr14343654plr.321.1528182023527; Tue, 05 Jun 2018 00:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528182023; cv=none; d=google.com; s=arc-20160816; b=MPpOraUJ0nqUM4wcf9ZrkbneOBcK7FMyvph1BFX/NXMrAORJMjr1wnkbIb9Czkl57A vqiD0oELGVZM1XSZ1uxhPoPQUnKNJGDcWa6YJj9YhpbVPyNwRg4HS+lV8KIu4uas78CY FJ0yd8bJB2oCTJu9xUdcjZwlZ32jGSRMT5T8XSBG6MplhkkPIExc7DiT1uzZhUYfY92+ Mbc3yc1VnA9cjmv4HOW7t192t8H/bd4mOJQ+yc2vujVnvq9SUyMSqfU58vWCzs8MyuBl pZxE5OjW/LcYmzSMcJJiLmC2i5XnzIeS/MtnL+WR4YcUE9prSMw3s60/YLXUzAkSWA7N 94xg== 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=SEE5H08+c8q7QpJ52U4HUINPW7im4lIsIS0H41sBpzw=; b=OEfXzJvbfUuxcbN+05oogVf++u7oRONjSgMzSmxqfR34Ehyc5AlJC/VYSgd/Cgdo+m CpiPvo/8/USumIbg+0lu2i9fVKyLkYX2TWGsU2dCnigODa2zqiophSMmF70Kdgf0G5Oc 1aJ4n0ZWCYeC3P1z4cNWiSDxbuurziLBfbFs9ucRHcsjDfRA1iBfjvtNMEh9/GLB+d98 heort66vNgjqixDhiR4KaqTOesUaIStz390aIAXbbSamKvnXvldYmTXnQbRehZ3GLjzh hd9Qk1p+KkLwknDS3mXH/iSE63/R+Zqh6XkcsRq/hcSC/WYom0YTpj6Zab2SjFCD5GNT tb9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iG6iaVFN; 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 a185-v6si37945293pgc.586.2018.06.05.00.00.08; Tue, 05 Jun 2018 00:00:23 -0700 (PDT) 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=iG6iaVFN; 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 S1751567AbeFEG7M (ORCPT + 99 others); Tue, 5 Jun 2018 02:59:12 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42344 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbeFEG7L (ORCPT ); Tue, 5 Jun 2018 02:59:11 -0400 Received: by mail-wr0-f196.google.com with SMTP id w10-v6so1091599wrk.9 for ; Mon, 04 Jun 2018 23:59:10 -0700 (PDT) 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=SEE5H08+c8q7QpJ52U4HUINPW7im4lIsIS0H41sBpzw=; b=iG6iaVFNmoZp3i8uLqMvV1H6FQMqtWVDgTWzHBdl8E99nB6HohlK3PbFBPiSYS49+X bm8oI/uFXzqU4l74g3LKvBx4EqYuHa8ao1fiVZHYU+pPXvCoAsy21rQK4N1/Rx3NfOmT N6XAuKQWc0noctQXShYhRAViGNT+/nOv9oOJc= 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=SEE5H08+c8q7QpJ52U4HUINPW7im4lIsIS0H41sBpzw=; b=Qe1ABYROndrArLjm4xoTP5iKFlKjZsPYduG7KBmwmFyAzLdGstsA7rVH8ozO3adbK/ 6iy/NOzV8lj9dhWePZozExsdwGJQ9dyRZFhlhkUKWKBr+gigqD7Zu6JxXgh80fJX14SD 2dC7oHftPKatjxDBZaoyLYCyJMmWKNAWbSZ6hSQt9nMhqlRYlp3GeDGPBQFDKDjX8NOH FLOtwQljnlgv4hiADlagF171td4VjO0c/I8XbQsbEJgzHnPKgAW6DIcN8vgSbFSYzFpd HWuqEwOFhBgBqxbVnPo7V4P+a+vXTlyKD4srce2kXAlSLoknYWFZFNqVW3OVum/aD67g OI/Q== X-Gm-Message-State: APt69E3/+RM8G5l876S/DfEimB15AAwNcOn68OdsGfLfF+TwfbkmHXOe n+v+BinpHzmegRrCZB+61LZ9PslIfCA= X-Received: by 2002:adf:9cca:: with SMTP id h10-v6mr4132759wre.11.1528181950207; Mon, 04 Jun 2018 23:59:10 -0700 (PDT) Received: from dell ([2.31.167.232]) by smtp.gmail.com with ESMTPSA id o16-v6sm12194140wrp.8.2018.06.04.23.59.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jun 2018 23:59:09 -0700 (PDT) Date: Tue, 5 Jun 2018 07:59:07 +0100 From: Lee Jones To: Gwendal Grignou Cc: bleung@chromium.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] cros_ec: Use devm_kzalloc for private data Message-ID: <20180605065907.GE21163@dell> References: <20180530165422.51178-1-gwendal@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180530165422.51178-1-gwendal@chromium.org> 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, 30 May 2018, Gwendal Grignou wrote: > Use dev_kzmalloc, remove .release entry point. > > Signed-off-by: Gwendal Grignou > --- > Change sinc v1: > - Readd __remove to avoid a warning when loaded as a module. > > drivers/mfd/cros_ec_dev.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c > index 1d6dc5c7a19d..81466264f7fc 100644 > --- a/drivers/mfd/cros_ec_dev.c > +++ b/drivers/mfd/cros_ec_dev.c > @@ -262,12 +262,7 @@ static const struct file_operations fops = { > #endif > }; > > -static void __remove(struct device *dev) > -{ > - struct cros_ec_dev *ec = container_of(dev, struct cros_ec_dev, > - class_dev); > - kfree(ec); > -} > +static void __remove(struct device *dev) { } I missed this line when reviewing. Why are you keeping the function around? As a result, we now suffer with a build warning: drivers/mfd/cros_ec_dev.c:265:13: warning: '__remove' defined but not used [-Wunused-function] static void __remove(struct device *dev) { } Can I just remove the line? What are the ramifications of doing so? Please reply swiftly, so resolve this issue in good time. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog