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=-7.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,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 54C26C4361B for ; Fri, 11 Dec 2020 14:54:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B6AB524685 for ; Fri, 11 Dec 2020 14:54:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6AB524685 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 E4AEB6B006C; Fri, 11 Dec 2020 09:54:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DD3B16B0070; Fri, 11 Dec 2020 09:54:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9AFA6B0071; Fri, 11 Dec 2020 09:54:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id ACA3F6B006C for ; Fri, 11 Dec 2020 09:54:22 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 56451180AD83E for ; Fri, 11 Dec 2020 14:54:22 +0000 (UTC) X-FDA: 77581297164.04.mark99_08022d127401 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 31BE680198BB for ; Fri, 11 Dec 2020 14:54:22 +0000 (UTC) X-HE-Tag: mark99_08022d127401 X-Filterd-Recvd-Size: 12925 Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Dec 2020 14:54:21 +0000 (UTC) Received: by mail-vs1-f65.google.com with SMTP id v8so4920648vso.2 for ; Fri, 11 Dec 2020 06:54:21 -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=/mkWdDnnI9wIuKSG7hC0y8Yz2KE2CeF+wrvfsVbGsuo=; b=DciqOhvP+JsphhJHMXu9hHu9wy8a9tCHQSKbe9x+7rDRSOaHmbpSI5kRxsG2PMEppS E3l7M4/HB6QvYq2NKDxClzMae7OQe7pi+q6sXXTw7zNnZ/tWDtaQ+p5JpCCtSN4brack 7A8rmvOTQUgNAYHORys5RgTi6bDEEeNr5rW5PYUEJb1yedgDr+nTE/II6jlL6IDTxln+ w9DMX54LkCwNDH5fuyyUsmuPZHWOqjtI9BpKry22K3nPzK6nU1n3wPK3jaY3DFXubmZD JXO2SgVPX1qlPYAVL36OGeo/moGkyH4ir48vqLJDet0UiZ+YM7or67PbgLXBK6CAGOWu 2oHg== 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=/mkWdDnnI9wIuKSG7hC0y8Yz2KE2CeF+wrvfsVbGsuo=; b=rGdNrOmnoiwcBPm5mYynn3jMlVFNfapaY9cDoWIzpsOE3KKDzADkMJQhPmbKLmGVbf C30GxLhBcwMnxuzX6qRx4IEmOlN0kBxvaeTYiRAf9SPdGW72d+SVdZPRUV16JDtKp9yc /fPh5qJfADB9gRuV3ePEhLhZHrNGC6JeNHxWpVXbqiQJmloBjkIFiz0fdSSG0guDsZOs /kMHYc/WtRYYOTuN9NbDpHCeeRHVX4bmdUUaN8QZuMNqjoyV2CO3MFD/Ws8CJkTc5Fi5 7XIv9rQf+JiKg93IUvEoMzgt2yFsRW+OqgVuzf18MdAgVVHl8vGZFPVd21HWKXw6I5I/ TRPg== X-Gm-Message-State: AOAM532Tbtu2p2bYVAK1sn+ToAE2qCKne++i7Yi98pcH0uKG02azkrjv yngdzIbGUsEnQ92AwVnvLesaKraRZjX9h+wNvoM= X-Google-Smtp-Source: ABdhPJzyPmWLf/ApAISbyy57fpZ1ufxoBF6mz2PFQ0N0u34JnIUmceXaUE+WFSonyQwZQH+Sz/oWsflhlXfgMUIipZA= X-Received: by 2002:a67:be17:: with SMTP id x23mr13454453vsq.59.1607698460651; Fri, 11 Dec 2020 06:54:20 -0800 (PST) MIME-Version: 1.0 References: <202012112150.CCpStiwY-lkp@intel.com> In-Reply-To: <202012112150.CCpStiwY-lkp@intel.com> From: Souptick Joarder Date: Fri, 11 Dec 2020 20:24:09 +0530 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: kernel test robot Cc: Fabio Estevam , 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.000000, 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 7:17 PM kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: 3cc2bd440f2171f093b3a8480a4b54d8c270ed38 > commit: 0ab785c894e618587e83bb67e8a8e96649868ad1 [6953/13205] dmaengine: imx-dma: Remove unused .id_table > config: arm64-randconfig-r012-20201211 (attached as .config) > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5ff35356f1af2bb92785b38c657463924d9ec386) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install arm64 cross compiling tool for clang build > # apt-get install binutils-aarch64-linux-gnu > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0ab785c894e618587e83bb67e8a8e96649868ad1 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 0ab785c894e618587e83bb67e8a8e96649868ad1 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > >> drivers/dma/imx-dma.c:1048:20: warning: cast to smaller integer type 'enum imx_dma_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] > imxdma->devtype = (enum imx_dma_type)of_device_get_match_data(&pdev->dev); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 warning generated. > > vim +1048 drivers/dma/imx-dma.c > > 1035 > 1036 static int __init imxdma_probe(struct platform_device *pdev) > 1037 { > 1038 struct imxdma_engine *imxdma; > 1039 struct resource *res; > 1040 int ret, i; > 1041 int irq, irq_err; > 1042 > 1043 imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL); > 1044 if (!imxdma) > 1045 return -ENOMEM; > 1046 > 1047 imxdma->dev = &pdev->dev; > > 1048 imxdma->devtype = (enum imx_dma_type)of_device_get_match_data(&pdev->dev); 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 ? - imxdma->devtype = pdev->id_entry->driver_data; > 1049 > 1050 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > 1051 imxdma->base = devm_ioremap_resource(&pdev->dev, res); > 1052 if (IS_ERR(imxdma->base)) > 1053 return PTR_ERR(imxdma->base); > 1054 > 1055 irq = platform_get_irq(pdev, 0); > 1056 if (irq < 0) > 1057 return irq; > 1058 > 1059 imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg"); > 1060 if (IS_ERR(imxdma->dma_ipg)) > 1061 return PTR_ERR(imxdma->dma_ipg); > 1062 > 1063 imxdma->dma_ahb = devm_clk_get(&pdev->dev, "ahb"); > 1064 if (IS_ERR(imxdma->dma_ahb)) > 1065 return PTR_ERR(imxdma->dma_ahb); > 1066 > 1067 ret = clk_prepare_enable(imxdma->dma_ipg); > 1068 if (ret) > 1069 return ret; > 1070 ret = clk_prepare_enable(imxdma->dma_ahb); > 1071 if (ret) > 1072 goto disable_dma_ipg_clk; > 1073 > 1074 /* reset DMA module */ > 1075 imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR); > 1076 > 1077 if (is_imx1_dma(imxdma)) { > 1078 ret = devm_request_irq(&pdev->dev, irq, > 1079 dma_irq_handler, 0, "DMA", imxdma); > 1080 if (ret) { > 1081 dev_warn(imxdma->dev, "Can't register IRQ for DMA\n"); > 1082 goto disable_dma_ahb_clk; > 1083 } > 1084 imxdma->irq = irq; > 1085 > 1086 irq_err = platform_get_irq(pdev, 1); > 1087 if (irq_err < 0) { > 1088 ret = irq_err; > 1089 goto disable_dma_ahb_clk; > 1090 } > 1091 > 1092 ret = devm_request_irq(&pdev->dev, irq_err, > 1093 imxdma_err_handler, 0, "DMA", imxdma); > 1094 if (ret) { > 1095 dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n"); > 1096 goto disable_dma_ahb_clk; > 1097 } > 1098 imxdma->irq_err = irq_err; > 1099 } > 1100 > 1101 /* enable DMA module */ > 1102 imx_dmav1_writel(imxdma, DCR_DEN, DMA_DCR); > 1103 > 1104 /* clear all interrupts */ > 1105 imx_dmav1_writel(imxdma, (1 << IMX_DMA_CHANNELS) - 1, DMA_DISR); > 1106 > 1107 /* disable interrupts */ > 1108 imx_dmav1_writel(imxdma, (1 << IMX_DMA_CHANNELS) - 1, DMA_DIMR); > 1109 > 1110 INIT_LIST_HEAD(&imxdma->dma_device.channels); > 1111 > 1112 dma_cap_set(DMA_SLAVE, imxdma->dma_device.cap_mask); > 1113 dma_cap_set(DMA_CYCLIC, imxdma->dma_device.cap_mask); > 1114 dma_cap_set(DMA_MEMCPY, imxdma->dma_device.cap_mask); > 1115 dma_cap_set(DMA_INTERLEAVE, imxdma->dma_device.cap_mask); > 1116 > 1117 /* Initialize 2D global parameters */ > 1118 for (i = 0; i < IMX_DMA_2D_SLOTS; i++) > 1119 imxdma->slots_2d[i].count = 0; > 1120 > 1121 spin_lock_init(&imxdma->lock); > 1122 > 1123 /* Initialize channel parameters */ > 1124 for (i = 0; i < IMX_DMA_CHANNELS; i++) { > 1125 struct imxdma_channel *imxdmac = &imxdma->channel[i]; > 1126 > 1127 if (!is_imx1_dma(imxdma)) { > 1128 ret = devm_request_irq(&pdev->dev, irq + i, > 1129 dma_irq_handler, 0, "DMA", imxdma); > 1130 if (ret) { > 1131 dev_warn(imxdma->dev, "Can't register IRQ %d " > 1132 "for DMA channel %d\n", > 1133 irq + i, i); > 1134 goto disable_dma_ahb_clk; > 1135 } > 1136 > 1137 imxdmac->irq = irq + i; > 1138 timer_setup(&imxdmac->watchdog, imxdma_watchdog, 0); > 1139 } > 1140 > 1141 imxdmac->imxdma = imxdma; > 1142 > 1143 INIT_LIST_HEAD(&imxdmac->ld_queue); > 1144 INIT_LIST_HEAD(&imxdmac->ld_free); > 1145 INIT_LIST_HEAD(&imxdmac->ld_active); > 1146 > 1147 tasklet_setup(&imxdmac->dma_tasklet, imxdma_tasklet); > 1148 imxdmac->chan.device = &imxdma->dma_device; > 1149 dma_cookie_init(&imxdmac->chan); > 1150 imxdmac->channel = i; > 1151 > 1152 /* Add the channel to the DMAC list */ > 1153 list_add_tail(&imxdmac->chan.device_node, > 1154 &imxdma->dma_device.channels); > 1155 } > 1156 > 1157 imxdma->dma_device.dev = &pdev->dev; > 1158 > 1159 imxdma->dma_device.device_alloc_chan_resources = imxdma_alloc_chan_resources; > 1160 imxdma->dma_device.device_free_chan_resources = imxdma_free_chan_resources; > 1161 imxdma->dma_device.device_tx_status = imxdma_tx_status; > 1162 imxdma->dma_device.device_prep_slave_sg = imxdma_prep_slave_sg; > 1163 imxdma->dma_device.device_prep_dma_cyclic = imxdma_prep_dma_cyclic; > 1164 imxdma->dma_device.device_prep_dma_memcpy = imxdma_prep_dma_memcpy; > 1165 imxdma->dma_device.device_prep_interleaved_dma = imxdma_prep_dma_interleaved; > 1166 imxdma->dma_device.device_config = imxdma_config; > 1167 imxdma->dma_device.device_terminate_all = imxdma_terminate_all; > 1168 imxdma->dma_device.device_issue_pending = imxdma_issue_pending; > 1169 > 1170 platform_set_drvdata(pdev, imxdma); > 1171 > 1172 imxdma->dma_device.copy_align = DMAENGINE_ALIGN_4_BYTES; > 1173 dma_set_max_seg_size(imxdma->dma_device.dev, 0xffffff); > 1174 > 1175 ret = dma_async_device_register(&imxdma->dma_device); > 1176 if (ret) { > 1177 dev_err(&pdev->dev, "unable to register\n"); > 1178 goto disable_dma_ahb_clk; > 1179 } > 1180 > 1181 if (pdev->dev.of_node) { > 1182 ret = of_dma_controller_register(pdev->dev.of_node, > 1183 imxdma_xlate, imxdma); > 1184 if (ret) { > 1185 dev_err(&pdev->dev, "unable to register of_dma_controller\n"); > 1186 goto err_of_dma_controller; > 1187 } > 1188 } > 1189 > 1190 return 0; > 1191 > 1192 err_of_dma_controller: > 1193 dma_async_device_unregister(&imxdma->dma_device); > 1194 disable_dma_ahb_clk: > 1195 clk_disable_unprepare(imxdma->dma_ahb); > 1196 disable_dma_ipg_clk: > 1197 clk_disable_unprepare(imxdma->dma_ipg); > 1198 return ret; > 1199 } > 1200 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org