From patchwork Thu Sep 22 06:22:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9345771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA17B607D0 for ; Thu, 22 Sep 2016 16:08:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A94EF2AB72 for ; Thu, 22 Sep 2016 16:08:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C3612ABA4; Thu, 22 Sep 2016 16:08:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B79222AB72 for ; Thu, 22 Sep 2016 16:08:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 230766E8F4; Thu, 22 Sep 2016 16:08:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD6AF6E8F4 for ; Thu, 22 Sep 2016 16:08:21 +0000 (UTC) Received: from [192.168.1.2] ([77.182.99.72]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0M4qon-1b3dJU2wfN-00yuRK; Thu, 22 Sep 2016 08:22:41 +0200 Subject: [PATCH 3/4] GPU-DRM-QXL: Improve a size determination in qxl_driver_load() To: dri-devel@lists.freedesktop.org, Bhaktipriya Shridhar , Daniel Vetter , David Airlie , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , Tejun Heo , Thierry Reding References: From: SF Markus Elfring Message-ID: <424ac093-cbe5-17f8-6e03-5e25d7e04269@users.sourceforge.net> Date: Thu, 22 Sep 2016 08:22:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:G/fmylpOfDLpO0HFbx66x5y8tUP4G/ayAoB3IsYH7LXTnPFhLRH ZwPdjPGdUnzGOKtOEoD1WfVwq+B368eGprn8Frwncew9zP9w1N4F8weh4cno1NHpFJYA+b8 Zjki9aC2a0MgMTXhbCZIVICHhh2rMRv29tqTUH+BI6x/df4DF7Lqc7HWgPLvmrX/2ft5h20 FCnIE1hH8M4K3jZnVFpXQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:v3c+z1fU8S8=:RdHbYYIwtATkir34e35Nvt 9NOPkUKsqpRKS8s03+30/hkPZROLwR6QxKBEIO/p+Lv7hzfCtAHOW3CAmioCxSAHl3hIBupLJ J61iRlY4AxPRnXqGZHzmlbNFe7fcvTZuaN10mgqriU89nkiFmCLAJBTY0vprvUAbFxfmPjHb2 Twblr8geCyVOJT+sR1ldnm7ioaaDL/lhc/KsOpktvtDWefJBgDarnTIKZr7zj+MSgYr9vNrox yczSv9xp8tjicNXtPEvjPN00lpu2bRECb5Cr66mIbiU3BOCJAoO3H9gfLaoNvwzwsem7YGcr3 cvpZ7UiK5KBtZZ378/EfCiF7ua/+zrwEENflZEvBFxT0Ogi0ogXO9e21ubHy1mHMfNLA541Zv JXQN5d+wjw0Ux9x3Or5Z/m+JtKbcMZFUaGL8+0PSpV6ZfRXCR5QJhorCd9AEOe5GjRDrDB8VU 5M7sPTSF0SGod5gkERJ/Y2AcrWHoTm7hh2dOZBeTpC7pnQ3yvHPG1fILKR3G1XRY3HxRZ/1kq bXaN5jPEYIlAzes1i64Bl7cKdvAYOHqJg+dNMEs8OeQvZJF2I8II9C34rAJrljZakYqy52Lzt X8wQZsp5iboLV/Q/kGS4xxXj4zDP2RM0oF/1rvHtzShPYD5dd0rnbQI6YaFNFlCxYMjx2H5qF cvUsOOvVYEMVwgcjlwogDo1PGapM5boUrLw8ONk3UHxtcJEqH6K3esoFU+3JxPSPhvsadMKcw Nk3VlEqC7PyTM268x08z1yJGUyRe0AnlxPkjXMydxv94SI2pEGYu9Qyy5An9UCtPLp+aRJ4R/ Ib80TZD Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 21 Sep 2016 22:48:34 +0200 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. Signed-off-by: Markus Elfring --- drivers/gpu/drm/qxl/qxl_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c index 76780c2..f8f0261 100644 --- a/drivers/gpu/drm/qxl/qxl_kms.c +++ b/drivers/gpu/drm/qxl/qxl_kms.c @@ -306,7 +306,7 @@ int qxl_driver_load(struct drm_device *dev, unsigned long flags) struct qxl_device *qdev; int r; - qdev = kzalloc(sizeof(struct qxl_device), GFP_KERNEL); + qdev = kzalloc(sizeof(*qdev), GFP_KERNEL); if (qdev == NULL) return -ENOMEM;