From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A5EFC4361B for ; Sat, 12 Dec 2020 15:40:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E536A2247F for ; Sat, 12 Dec 2020 15:40:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E536A2247F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3E7F06B005C; Sat, 12 Dec 2020 10:40:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 398266B0068; Sat, 12 Dec 2020 10:40:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AD546B006C; Sat, 12 Dec 2020 10:40:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 164EC6B005C for ; Sat, 12 Dec 2020 10:40:36 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D1F8A181AEF30 for ; Sat, 12 Dec 2020 15:40:35 +0000 (UTC) X-FDA: 77585042430.29.story02_37140d02740a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 9F79C18084CD2 for ; Sat, 12 Dec 2020 15:40:35 +0000 (UTC) X-HE-Tag: story02_37140d02740a X-Filterd-Recvd-Size: 3674 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Sat, 12 Dec 2020 15:40:35 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id r24so19105352lfm.8 for ; Sat, 12 Dec 2020 07:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OD9KwxKTMuuboae4UQkqkFVGnvzi23O6J0ZwMpP3sSQ=; b=QMnE2e6N9zaEHvz/Tp7S3qlbcFw8w5el/7RnoIuqnAtpzzJsuUmOW4059GA9mCybJk MP99PzYs8ePh7lResEWVj0Z50UkKfjwjwPDFClNRhVBq3s2/QCFXHoN+ga/0egi8N2So h1AxH5N8NjkeaZQ6gBU6UShq1J02g2JjtJ5I1V2dPO/eib2pPk+p8UVc75F5Dx5k4X/E b139XegggdLxIM6O0Vhz/7fcKeJCDsJbe28IcMvVhc+g4uRMgvbfFKkOASPhwyNyM3u7 qqu67xpoqYQsv8opLTQBAcKFPjz2oK6NWz2pKVWwHizNnWCbtM5yh9KUd+rsy8A2el51 YzYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OD9KwxKTMuuboae4UQkqkFVGnvzi23O6J0ZwMpP3sSQ=; b=kbzErm2Q7xSJVgHFLJaK4/H6qeAw3RsGkyJrUpHKrdVCBy/VuObksUJIvGiSOZ55+6 atxbA/qNWsp0UQAAGkqGR9GM20KRN0aEsSP9dPsGtqCJTPdgcQQFbsgZviMI8VXzWWPH XDakCp2r6fZaT8bNmYhwznizCc+dKsZhVTNc/MVSjKwlY0suRlv0eqtrO62OgcT+PvPX pLqaRmKSyGDESjLRk0+qnZ9EBohACAXMEcdItwT4RgR/xWSgRsxZKd8mGXhrOYe3gau3 DiQUCcJjZxHcQLrqr+GzY6fB5xhBfYMkLttTe8rJ4vzHnlawnuYTt1HQg+TBKQbJX8eR kbXQ== X-Gm-Message-State: AOAM532M9v2r0GUBnmldmRH+FcVNmH7CcDIBWchcwzIuGHfPqX34kEJE eEbnnH8zqX887eDQLyhnEkotLFAVQ9BHeyiA/OA= X-Google-Smtp-Source: ABdhPJziim5DTEoHbPtS/IWph9LV8Tl8T5pj0I2VYq4FHhMbwByZKy507qTkJVCS6PnsqhPkrLck/1OppKVPySDDau4= X-Received: by 2002:a2e:8750:: with SMTP id q16mr7317171ljj.53.1607787633585; Sat, 12 Dec 2020 07:40:33 -0800 (PST) MIME-Version: 1.0 References: <202012112150.CCpStiwY-lkp@intel.com> In-Reply-To: From: Fabio Estevam Date: Sat, 12 Dec 2020 12:40:22 -0300 Message-ID: Subject: Re: [linux-next:master 6953/13205] drivers/dma/imx-dma.c:1048:20: warning: cast to smaller integer type 'enum imx_dma_type' from 'const void To: Souptick Joarder Cc: kernel test robot , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Linux Memory Management List , Vinod Koul Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000023, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Dec 11, 2020 at 11:54 AM Souptick Joarder wrote: > of_device_get_match_data() returns void * which is assigned to enum > imx_dma_type type without extracting > the value. Anything wrong with the previous assignment ? The driver data is now passed via: imxdma->devtype = (enum imx_dma_type)of_device_get_match_data(&pdev->dev); There was nothing wrong with the previous assignment. The original driver used to run on non-DT platforms. Now it only runs on DT-platforms, which means we no longer need the platform data structure. Please note that this a W=1 clang warning. gcc does not complain about it. Not sure how to make clang happy in this case. The (enum ....)of_device_get_match_data() cast is widely used in the kernel, so this is not specific usage in this driver. From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8786078618071304741==" MIME-Version: 1.0 From: Fabio Estevam To: kbuild-all@lists.01.org Subject: Re: [linux-next:master 6953/13205] drivers/dma/imx-dma.c:1048:20: warning: cast to smaller integer type 'enum imx_dma_type' from 'const void Date: Sat, 12 Dec 2020 12:40:22 -0300 Message-ID: In-Reply-To: List-Id: --===============8786078618071304741== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, Dec 11, 2020 at 11:54 AM Souptick Joarder = wrote: > of_device_get_match_data() returns void * which is assigned to enum > imx_dma_type type without extracting > the value. Anything wrong with the previous assignment ? The driver data is now passed via: imxdma->devtype =3D (enum imx_dma_type)of_device_get_match_data(&pdev->dev); There was nothing wrong with the previous assignment. The original driver used to run on non-DT platforms. Now it only runs on DT-platforms, which means we no longer need the platform data structure. Please note that this a W=3D1 clang warning. gcc does not complain about it. Not sure how to make clang happy in this case. The (enum ....)of_device_get_match_data() cast is widely used in the kernel, so this is not specific usage in this driver. --===============8786078618071304741==--