Received: by 10.223.176.5 with SMTP id f5csp1980976wra; Thu, 8 Feb 2018 06:40:16 -0800 (PST) X-Google-Smtp-Source: AH8x2240UdDEZ1GfFSLD7eHqRHGwaxtUYVulosuxMDVwLT+IVh+ww2glgKcAFcdf4yNrmhILYcen X-Received: by 2002:a17:902:8c89:: with SMTP id t9-v6mr843747plo.2.1518100816080; Thu, 08 Feb 2018 06:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518100816; cv=none; d=google.com; s=arc-20160816; b=IsED25tGb83jR8lNBrdLpSllG6f8Q78Yh1Jou0OQ4DNP1xagmmxUyPm44bmiGJHOL0 CsNa94ebDpNuMHjgZ5OgA+QG9HA38ZrBuwXCpX9Lkafs463X9vq0jf36jIcXjqJvLgQ/ UjsSGG0L8ztZdVpmIhq4ANH32t32CfLAu7LNw0HjUz59Z1i37lnT4mpU1O80vEGSnfB8 +PZjv0MReKpuhq1rXgB1f8FE1B45xOWSV+75qac+VPOs7mWrbaJCOUomIh8eCYUOiwVl wH5ZzcRPqjOR6ku9KRM83BXQ/HerzVOYLIegLW6SI2TkYZCfYmlmYvrSSulqbKFQyoxE LT1g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=WNGuGAdhE1PWD8QTjKtAn9OB9AK5frLELHAd6CCBb8M=; b=CFZP3Yp7e0WKJKg4DfNR3bgM/qMtGXmLpzuSRFatP9wRFC9igTibSArhV5Vyiz6ngc woYyn3bm9wEpnq2Vq/l1ZeuwzytsRTB9+wvxvaz6DF6kH5j7w0oD1VEOnIqvwHOm6gWt GqJOBbZDGJ86VzChGHKSxUx5UaqCup74PpmUVJOzpO59wu3+FnSOf4lGgd7l1Txy8Ij5 F5fg94mqRQ/qqe/greki/aDeMAO8E3BAFSIAuuwrqd/kAvDspVKDMb70LEcGseY/DAo5 ToI31aBaQv8MFwotN3DdlhZA49ifvgmKwTUCr0fXi49arJz/LI4Ftk6v8/HvIT0tMSFx Woew== 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g59-v6si6058plb.469.2018.02.08.06.40.02; Thu, 08 Feb 2018 06:40:16 -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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbeBHOit (ORCPT + 99 others); Thu, 8 Feb 2018 09:38:49 -0500 Received: from mout.web.de ([212.227.15.14]:42457 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbeBHOis (ORCPT ); Thu, 8 Feb 2018 09:38:48 -0500 Received: from [192.168.1.2] ([78.49.237.151]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MbhSP-1eRJ7m2ETN-00J1kq; Thu, 08 Feb 2018 15:38:43 +0100 Subject: [PATCH 2/3] drm/gma500: Improve four size determinations From: SF Markus Elfring To: dri-devel@lists.freedesktop.org, David Airlie , Patrik Jakobsson Cc: LKML , kernel-janitors@vger.kernel.org References: <079c31b2-a2e6-cf42-cecb-e1e10dd241f6@users.sourceforge.net> Message-ID: <9165671d-8a07-30e7-c0ee-936e91331297@users.sourceforge.net> Date: Thu, 8 Feb 2018 15:38:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <079c31b2-a2e6-cf42-cecb-e1e10dd241f6@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:a8Tdv8hgQUOvzTfyPOZPjtUfzNHgqhBiIjXzSsLtD9w6pDSwQuY xNJS+6okzGROZ0v9qbT0bszkK9eEmCbQJD3yojNMDbKQsOcCvExyZ8DrDDHOmO4pAGhXmgw Sr5Bc/7ffrbnLG0DLz3MC9Ev8l/5o2SyA/EreDNth+lXoWxIkniHqlObGBPbpwC364wp1SU WdhKjrTf0jqnlmhcvEMew== X-UI-Out-Filterresults: notjunk:1;V01:K0:auIJ8o99ETY=:zSPtb3DQXOmYl77PSxL24U A5/J9/6zPfj/uF1qI2K9Ls9Al9DGnVH8/PELCiTtmIEndiSVn14ZJJUwMXbbJe/gdWGE3ybvH 4S+yk6eJP8PhZUeaf49hjrhgKTgX5HwCwHtIUf7FL3bmeb40I6ZCSu1kRyftk24iD046iShsU XPlv8XC2awXnZrYkkU28xoLTgHtUz7FkUQG9q2kkO+7+JCeYqF1z3jZUgjhpkcVCS702CSNuv CGlv0XSjjHL9TcdMJDT3VLTuv8MUis/n9TnoqhaRjnyH55j4EM5LosBjDLCpBl1RFJ/qwYE89 ykSyK52cwGorA3GdkckVeP7uOmC9FrnRc9AxvpBwkBuftWmsKQSMer0lxANgU9joY1n7qUxay WtOIlHOKjHNECbICHeqz3G/8OBzSj7E+Gg0XvpVd0+gUrOMegxirjc8hJyIbCYA3OHdF/1PqX +Vb/m2x9MCTHtIqiLxjLPJitTqgPKGHDczgPzgpZxYSlPu+a5IuIAcwGVXi2zhrkrlSpnAK/F RLbhalLfLQSJ7L9wB6zXsD0CszyDZ3m0tAZWeF9VdBixR19DM+xuS8uzF/QRtTUE28NoTqzHO zmKPHr4AShsLjJ3UdRmoFUXkYGiaUzxZ03zTPvKwv8M3Gsc7rxbBjXH4LKAWyDSuRdIziIUzD eJj9Y30lhXzscXGo37Ail/2zpGBbCG/XMVw07W8DGDRAm4z/Eeb8xDv/oKmA/1mhJmYMk0Qdw f7PyEQM2XMkj3CrUh4k0VbJth/4ZMfzAgMwkqUkb7TQFK0EehkPo/IXxAWB87b3iLB/4O+m9y qCaXV4aFMW3X70EqoIBKC2+Oq429cE/xZXCUsHf+mwec5m6U8w= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Thu, 8 Feb 2018 15:08:39 +0100 Replace the specification of data structures by pointer dereferences 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/gpu/drm/gma500/framebuffer.c | 3 +-- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 3ff320f3ff47..ad96a542d137 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -525,11 +525,10 @@ static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev) int psb_fbdev_init(struct drm_device *dev) { - struct psb_fbdev *fbdev; struct drm_psb_private *dev_priv = dev->dev_private; int ret; + struct psb_fbdev *fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); - fbdev = kzalloc(sizeof(struct psb_fbdev), GFP_KERNEL); if (!fbdev) return -ENOMEM; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index d9a6d54b6641..dbc58e5130bb 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c @@ -637,11 +637,11 @@ void oaktrail_hdmi_init(struct drm_device *dev, struct drm_connector *connector; struct drm_encoder *encoder; - gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL); + gma_encoder = kzalloc(sizeof(*gma_encoder), GFP_KERNEL); if (!gma_encoder) return; - gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL); + gma_connector = kzalloc(sizeof(*gma_connector), GFP_KERNEL); if (!gma_connector) goto failed_connector; @@ -689,7 +689,7 @@ void oaktrail_hdmi_setup(struct drm_device *dev) if (!pdev) return; - hdmi_dev = kzalloc(sizeof(struct oaktrail_hdmi_dev), GFP_KERNEL); + hdmi_dev = kzalloc(sizeof(*hdmi_dev), GFP_KERNEL); if (!hdmi_dev) goto out; -- 2.16.1