Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1465253ybt; Thu, 2 Jul 2020 06:16:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd3oIZMsFHOva5z3qs7lGK+dKhggm2GbQ515EyElSmbymXxssk/aGdZQ5Wu2OEgIYgsyDm X-Received: by 2002:a05:6402:c83:: with SMTP id cm3mr36047695edb.307.1593695814295; Thu, 02 Jul 2020 06:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593695814; cv=none; d=google.com; s=arc-20160816; b=bDnFnGzTEv6ROdmfkDYsU8ar+YCvf38ljzBCfq3w+kXTo/kVoWa5IBpA77KxYVAVn8 HIx288yvkQMNMb30oum02/786H63ygMwb42kD/iga1i9Q0qpFroCIlKTyY7BGkJWE30C xIlbIY+Ir737vivTX0DfiP80wfCZUGqbhtNPmRz2KS4EXxnJ/zzgq+hGzYXZTt7MHRJY f7W4rC3GCZQ6A2B+XKQpBd2kW2bxQopJ3Dcp7mrk91fipW9qEqZ8kPKfclDOWP2I9N+Y MSZ7tO5iJcL7dab6FQOFXEXGo0pq1E05MP69AZcFvgvOZkz4SfVIA+lxBclZopa1qvDK Ybuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=nC8Lz2S3EJ6vZ8/1nqOq5YPWNqhdwapmW7150qhoX70=; b=ZHbZOEHi2lBI7JMq2atn0n+p53OnSoGKNslgCVR8MnOjDRbwwvYBBY3wHUKUqZJE5J YihjUDGFMZs2O260//HEpjFrLPBaSHZtmTx0FcQTpFP4M5W0AeFEp76Vpbnt3XNpOCng +BCy0S/jGC29qbAQwPFfmvJfFFN6i9p8sWsUCVhE6yH4UsZPr/8Sx8sGE4rTizHE86WN yS36Zsl1cmWwoLMWyynun2n+t1w951eUGDH6JNP9+Mv/++iwvn+zux0gBcZpn/VT+so5 RrKGCmzS9+mZMk+Lg9OFEyyz7FP4TeLKWOxs3XWhtj8BewtoOxkLSPdv0c5RWeSnsQQG Dgng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=aZmuATkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt20si7091357ejc.24.2020.07.02.06.16.30; Thu, 02 Jul 2020 06:16:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=aZmuATkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729122AbgGBNQW (ORCPT + 99 others); Thu, 2 Jul 2020 09:16:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbgGBNQW (ORCPT ); Thu, 2 Jul 2020 09:16:22 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02FE4C08C5C1 for ; Thu, 2 Jul 2020 06:16:22 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z2so6041538wrp.2 for ; Thu, 02 Jul 2020 06:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=nC8Lz2S3EJ6vZ8/1nqOq5YPWNqhdwapmW7150qhoX70=; b=aZmuATkxN/T6ldpfVP9oIFv/9MPvKQJaWmFWtXeCizxERJyB0kmerR8d9J/2QG92gR wFf/e3ARMhNbdik7W71HDtbl9Tokf8XkywH1oQWJVsk0yHWffMp0jWt4PLuE9YJXoiGV NMb+oJ3sXAXjczCrTHPemuNtyUbfJCqlQSN4U= 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=nC8Lz2S3EJ6vZ8/1nqOq5YPWNqhdwapmW7150qhoX70=; b=JLQTOyrb+r2lg0vzFAy0Ol+1lsAlVal4klH8SrqCxfU9VlFanRSIqREDFFVl7zqmC+ EMES5VyhjpVeaaa8hu+dGRdxM0dp7vRu91KADzUVYu0oEeBx+TAxPtRKk38z6a8yVxaz k3Mxvgs6l1DoiGY5SMmKoahslaM36XlxdLw8QtJMZrwIrycve3brCH779tzibH/2YS30 oqHk7dT726jVb7MpaVwvJuI9xaPasiF6/7td1yC72I7KDdoeG3rmZ1jEonIaAqJn09Zq feide8ELo78S6FnVT4jy0vNngbNxkJT2gXsVA3efHX57Jpw+XJLkZy2bPxhQtc+Q3mCc qmXA== X-Gm-Message-State: AOAM531cTPQj3HNpkwhrFN1PdN89hBv5guDSQydylPGfSCTQbCVSScNw hVIp/7lSqVUomtdTpX4uf8dltQ== X-Received: by 2002:adf:fd46:: with SMTP id h6mr9845741wrs.105.1593695780741; Thu, 02 Jul 2020 06:16:20 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id e23sm10144322wme.35.2020.07.02.06.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 06:16:19 -0700 (PDT) Date: Thu, 2 Jul 2020 15:16:17 +0200 From: Daniel Vetter To: Tian Tao Cc: puck.chen@hisilicon.com, airlied@linux.ie, daniel@ffwll.ch, tzimmermann@suse.de, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org, inuxarm@huawei.com Subject: Re: [PATCH] drm/hisilicon: Use drmm_kzalloc() instead of devm_kzalloc() Message-ID: <20200702131617.GY3278063@phenom.ffwll.local> Mail-Followup-To: Tian Tao , puck.chen@hisilicon.com, airlied@linux.ie, tzimmermann@suse.de, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org, inuxarm@huawei.com References: <1593652914-19639-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1593652914-19639-1-git-send-email-tiantao6@hisilicon.com> X-Operating-System: Linux phenom 5.6.0-1-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 02, 2020 at 09:21:54AM +0800, Tian Tao wrote: > using the new API drmm_kzalloc() instead of devm_kzalloc() > > Signed-off-by: Tian Tao > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > index a6fd0c2..2f20704 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > #include "hibmc_drm_drv.h" > #include "hibmc_drm_regs.h" > @@ -267,7 +268,7 @@ static int hibmc_load(struct drm_device *dev) > struct hibmc_drm_private *priv; > int ret; > > - priv = devm_kzalloc(dev->dev, sizeof(*priv), GFP_KERNEL); > + priv = drmm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); Hm would be nice if hisilicon could entirely switch over to embedding, and stop using the driver private pointer. Quite a bit more work though. As-is this change here isn't really brining you closer to that, pretty much all the lifetime bugs around hotunload are still there. -Daniel > if (!priv) { > DRM_ERROR("no memory to allocate for hibmc_drm_private\n"); > return -ENOMEM; > -- > 2.7.4 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch