From patchwork Thu Apr 25 06:27:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10916221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F4C3161F for ; Thu, 25 Apr 2019 07:41:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73FA528BA6 for ; Thu, 25 Apr 2019 07:41:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6813228BDE; Thu, 25 Apr 2019 07:41:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 2315D28BA6 for ; Thu, 25 Apr 2019 07:41:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3531689312; Thu, 25 Apr 2019 07:40:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8501D89292 for ; Thu, 25 Apr 2019 06:27:51 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id a6so18146179edv.1 for ; Wed, 24 Apr 2019 23:27:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mDp+b9LU8OTRCUXLqnc4r3oCSoAaP8pMwmufyd6e2IU=; b=dpDHb7ompk/rqiWOGb2ykgatGBHYwquRsr5UwFBwpREwBtSOh0V8oVvBSSNS1fYI27 C+7Y2yl4h5Vm/t7sJG39Nt5K2RO01x4qO0Qp/DLn93gacw+9EYiGHb6A9UuQwID8Y5RD oJCv4QGpaAI/sxpkOe06tbwgb9v/u1FMLklwZCbTSivLgTpbNnqxvkw9HN4GQoKhYNzM mJOV/Epw+neF9qveLBnFBA33wHe7HTZLzA+ZcewlsbnV+wFH8nCdRIIA4ldt6GYGswht hQvWkd0evnXNau9+1cuRn/wI1UKvF/qz2nY/ZvmYekg+jRaTRw8r3xMpV5lwN/RGBt3o INXQ== X-Gm-Message-State: APjAAAWm3IdqWOAWGyvPr2UzxGwd+du2QmvueXLuN28vDWnOXnKr/ZL2 x3nXfl9uqa4uOHfLoOBgp3M= X-Google-Smtp-Source: APXvYqyYC4n/FPJ/33z7Dn9+iLP+NoASddKBqqq3Sh617uZGlk+8ewLfuEVy3ZsWQd1Ph6I9EzbstQ== X-Received: by 2002:a50:cb4d:: with SMTP id h13mr9174290edi.110.1556173669884; Wed, 24 Apr 2019 23:27:49 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f9:2b:2b84::2]) by smtp.gmail.com with ESMTPSA id m3sm1977654ejc.5.2019.04.24.23.27.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 23:27:49 -0700 (PDT) From: Nathan Chancellor To: "James (Qian) Wang" , Liviu Dudau , Brian Starkey Subject: [PATCH] drm/komeda: Use memset to initialize config_id Date: Wed, 24 Apr 2019 23:27:20 -0700 Message-Id: <20190425062720.26695-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Patchwork-Bot: notify X-Mailman-Approved-At: Thu, 25 Apr 2019 07:40:14 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mDp+b9LU8OTRCUXLqnc4r3oCSoAaP8pMwmufyd6e2IU=; b=X8PTPF3KdGUtYxvjY/Ui+xWTPfLAZmmoDhXHWzz9roAq6pL+fUGdP4+ulvrTbiAQPW HvN+rGj7J6KsxyoqQhCZHCt+DalnHKgWb/Rq40wrEPPUi2dfgRx833+ya7St9a+i+x3g jjZ3+ivjhKxkGs34dETj03v/oCsQGzCKn/vr5bcq5D3/VSBvdYITFWa0Yd5J1ozwjcUt kXEylHAjHPybPrZRKnPkbHdz3mGmpnyowCGVNA/0KfgNFJ/NNMqSV3V4RmpwHHZdcAKB YfyEOjxRlZ9iSciG1pHYx2BI/Z3/nAV5pdv9veEjw86vF59SKjrPkp2zf9bMobt3Z1+g RtKg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Desaulniers , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, clang-built-linux@googlegroups.com, malidp@foss.arm.com, Nathan Chancellor Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang warns: drivers/gpu/drm/arm/display/komeda/komeda_dev.c:76:38: warning: suggest braces around initialization of subobject [-Wmissing-braces] union komeda_config_id config_id = {0,}; ^ {} 1 warning generated. One way to fix these warnings is to add additional braces like Clang suggests; however, there has been a bit of push back from some maintainers, who just prefer memset as it is unambiguous, doesn't depend on a particular compiler version, and properly initializes all subobjects [1][2]. Do that here so there are no more warnings. [1]: https://lore.kernel.org/lkml/022e41c0-8465-dc7a-a45c-64187ecd9684@amd.com/ [2]: https://lore.kernel.org/lkml/20181128.215241.702406654469517539.davem@davemloft.net/ Fixes: 4cc734cb79a8 ("drm/komeda: Add sysfs attribute: core_id and config_id") Link: https://github.com/ClangBuiltLinux/linux/issues/457 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index 9d6c31cca875..e605a518f59a 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -73,9 +73,10 @@ config_id_show(struct device *dev, struct device_attribute *attr, char *buf) { struct komeda_dev *mdev = dev_to_mdev(dev); struct komeda_pipeline *pipe = mdev->pipelines[0]; - union komeda_config_id config_id = {0,}; + union komeda_config_id config_id; int i; + memset(&config_id, 0, sizeof(config_id)); config_id.max_line_sz = pipe->layers[0]->hsize_in.end; config_id.n_pipelines = mdev->n_pipelines; config_id.n_scalers = pipe->n_scalers;