RE: [vkoul-dmaengine:next 45/56] drivers/dma/sa11x0-dma.c:1042:12: error: 'sa11x0_dma_resume' defined but not used

From: Cai,Huoqing
Date: Mon Oct 25 2021 - 22:52:34 EST


Hello,
This patch fix it.
https://lore.kernel.org/lkml/20211026020508.550-1-caihuoqing@xxxxxxxxx/

> -----Original Message-----
> From: kernel test robot <lkp@xxxxxxxxx>
> Sent: 2021年10月26日 1:55
> To: Cai,Huoqing
> Cc: kbuild-all@xxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Vinod Koul
> Subject: [vkoul-dmaengine:next 45/56] drivers/dma/sa11x0-dma.c:1042:12:
> error: 'sa11x0_dma_resume' defined but not used
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
> head: 981b43434b28cff9ddc490e212f49e905c18bda1
> commit: 7789e3464cb610cb8925cd8605bc0aa9d088280d [45/56] dmaengine:
> sa11x0: Make use of the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS()
> config: parisc-allyesconfig (attached as .config)
> compiler: hppa-linux-gcc (GCC) 11.2.0
> 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
> #
> https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/commit/?i
> d=7789e3464cb610cb8925cd8605bc0aa9d088280d
> git remote add vkoul-dmaengine
> https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git
> git fetch --no-tags vkoul-dmaengine next
> git checkout 7789e3464cb610cb8925cd8605bc0aa9d088280d
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0
> make.cross ARCH=parisc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All errors (new ones prefixed by >>):
>
> >> drivers/dma/sa11x0-dma.c:1042:12: error: 'sa11x0_dma_resume' defined but
> not used [-Werror=unused-function]
> 1042 | static int sa11x0_dma_resume(struct device *dev)
> | ^~~~~~~~~~~~~~~~~
> >> drivers/dma/sa11x0-dma.c:1004:12: error: 'sa11x0_dma_suspend' defined
> but not used [-Werror=unused-function]
> 1004 | static int sa11x0_dma_suspend(struct device *dev)
> | ^~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
>
> vim +/sa11x0_dma_resume +1042 drivers/dma/sa11x0-dma.c
>
> 6365bead25efc8 Russell King 2012-01-09 1003
> 6365bead25efc8 Russell King 2012-01-09 @1004 static int
> sa11x0_dma_suspend(struct device *dev)
> 6365bead25efc8 Russell King 2012-01-09 1005 {
> 6365bead25efc8 Russell King 2012-01-09 1006 struct sa11x0_dma_dev *d =
> dev_get_drvdata(dev);
> 6365bead25efc8 Russell King 2012-01-09 1007 unsigned pch;
> 6365bead25efc8 Russell King 2012-01-09 1008
> 6365bead25efc8 Russell King 2012-01-09 1009 for (pch = 0; pch <
> NR_PHY_CHAN; pch++) {
> 6365bead25efc8 Russell King 2012-01-09 1010 struct
> sa11x0_dma_phy *p = &d->phy[pch];
> 6365bead25efc8 Russell King 2012-01-09 1011 u32 dcsr, saved_dcsr;
> 6365bead25efc8 Russell King 2012-01-09 1012
> 6365bead25efc8 Russell King 2012-01-09 1013 dcsr = saved_dcsr =
> readl_relaxed(p->base + DMA_DCSR_R);
> 6365bead25efc8 Russell King 2012-01-09 1014 if (dcsr & DCSR_RUN) {
> 6365bead25efc8 Russell King 2012-01-09 1015
> writel(DCSR_RUN | DCSR_IE, p->base + DMA_DCSR_C);
> 6365bead25efc8 Russell King 2012-01-09 1016 dcsr =
> readl_relaxed(p->base + DMA_DCSR_R);
> 6365bead25efc8 Russell King 2012-01-09 1017 }
> 6365bead25efc8 Russell King 2012-01-09 1018
> 6365bead25efc8 Russell King 2012-01-09 1019 saved_dcsr &=
> DCSR_RUN | DCSR_IE;
> 6365bead25efc8 Russell King 2012-01-09 1020 if (dcsr & DCSR_BIU) {
> 6365bead25efc8 Russell King 2012-01-09 1021 p->dbs[0] =
> readl_relaxed(p->base + DMA_DBSB);
> 6365bead25efc8 Russell King 2012-01-09 1022 p->dbt[0] =
> readl_relaxed(p->base + DMA_DBTB);
> 6365bead25efc8 Russell King 2012-01-09 1023 p->dbs[1] =
> readl_relaxed(p->base + DMA_DBSA);
> 6365bead25efc8 Russell King 2012-01-09 1024 p->dbt[1] =
> readl_relaxed(p->base + DMA_DBTA);
> 6365bead25efc8 Russell King 2012-01-09 1025 saved_dcsr |=
> (dcsr & DCSR_STRTA ? DCSR_STRTB : 0) |
> 6365bead25efc8 Russell King 2012-01-09 1026
> (dcsr & DCSR_STRTB ? DCSR_STRTA : 0);
> 6365bead25efc8 Russell King 2012-01-09 1027 } else {
> 6365bead25efc8 Russell King 2012-01-09 1028 p->dbs[0] =
> readl_relaxed(p->base + DMA_DBSA);
> 6365bead25efc8 Russell King 2012-01-09 1029 p->dbt[0] =
> readl_relaxed(p->base + DMA_DBTA);
> 6365bead25efc8 Russell King 2012-01-09 1030 p->dbs[1] =
> readl_relaxed(p->base + DMA_DBSB);
> 6365bead25efc8 Russell King 2012-01-09 1031 p->dbt[1] =
> readl_relaxed(p->base + DMA_DBTB);
> 6365bead25efc8 Russell King 2012-01-09 1032 saved_dcsr |=
> dcsr & (DCSR_STRTA | DCSR_STRTB);
> 6365bead25efc8 Russell King 2012-01-09 1033 }
> 6365bead25efc8 Russell King 2012-01-09 1034 p->dcsr = saved_dcsr;
> 6365bead25efc8 Russell King 2012-01-09 1035
> 6365bead25efc8 Russell King 2012-01-09 1036 writel(DCSR_STRTA |
> DCSR_STRTB, p->base + DMA_DCSR_C);
> 6365bead25efc8 Russell King 2012-01-09 1037 }
> 6365bead25efc8 Russell King 2012-01-09 1038
> 6365bead25efc8 Russell King 2012-01-09 1039 return 0;
> 6365bead25efc8 Russell King 2012-01-09 1040 }
> 6365bead25efc8 Russell King 2012-01-09 1041
> 6365bead25efc8 Russell King 2012-01-09 @1042 static int
> sa11x0_dma_resume(struct device *dev)
> 6365bead25efc8 Russell King 2012-01-09 1043 {
> 6365bead25efc8 Russell King 2012-01-09 1044 struct sa11x0_dma_dev *d =
> dev_get_drvdata(dev);
> 6365bead25efc8 Russell King 2012-01-09 1045 unsigned pch;
> 6365bead25efc8 Russell King 2012-01-09 1046
> 6365bead25efc8 Russell King 2012-01-09 1047 for (pch = 0; pch <
> NR_PHY_CHAN; pch++) {
> 6365bead25efc8 Russell King 2012-01-09 1048 struct
> sa11x0_dma_phy *p = &d->phy[pch];
> 6365bead25efc8 Russell King 2012-01-09 1049 struct
> sa11x0_dma_desc *txd = NULL;
> 6365bead25efc8 Russell King 2012-01-09 1050 u32 dcsr =
> readl_relaxed(p->base + DMA_DCSR_R);
> 6365bead25efc8 Russell King 2012-01-09 1051
> 6365bead25efc8 Russell King 2012-01-09 1052 WARN_ON(dcsr &
> (DCSR_BIU | DCSR_STRTA | DCSR_STRTB | DCSR_RUN));
> 6365bead25efc8 Russell King 2012-01-09 1053
> 6365bead25efc8 Russell King 2012-01-09 1054 if (p->txd_done)
> 6365bead25efc8 Russell King 2012-01-09 1055 txd = p-
> >txd_done;
> 6365bead25efc8 Russell King 2012-01-09 1056 else if (p->txd_load)
> 6365bead25efc8 Russell King 2012-01-09 1057 txd = p-
> >txd_load;
> 6365bead25efc8 Russell King 2012-01-09 1058
> 6365bead25efc8 Russell King 2012-01-09 1059 if (!txd)
> 6365bead25efc8 Russell King 2012-01-09 1060 continue;
> 6365bead25efc8 Russell King 2012-01-09 1061
> 6365bead25efc8 Russell King 2012-01-09 1062 writel_relaxed(txd-
> >ddar, p->base + DMA_DDAR);
> 6365bead25efc8 Russell King 2012-01-09 1063
> 6365bead25efc8 Russell King 2012-01-09 1064 writel_relaxed(p-
> >dbs[0], p->base + DMA_DBSA);
> 6365bead25efc8 Russell King 2012-01-09 1065 writel_relaxed(p-
> >dbt[0], p->base + DMA_DBTA);
> 6365bead25efc8 Russell King 2012-01-09 1066 writel_relaxed(p-
> >dbs[1], p->base + DMA_DBSB);
> 6365bead25efc8 Russell King 2012-01-09 1067 writel_relaxed(p-
> >dbt[1], p->base + DMA_DBTB);
> 6365bead25efc8 Russell King 2012-01-09 1068 writel_relaxed(p->dcsr,
> p->base + DMA_DCSR_S);
> 6365bead25efc8 Russell King 2012-01-09 1069 }
> 6365bead25efc8 Russell King 2012-01-09 1070
> 6365bead25efc8 Russell King 2012-01-09 1071 return 0;
> 6365bead25efc8 Russell King 2012-01-09 1072 }
> 6365bead25efc8 Russell King 2012-01-09 1073
>
> :::::: The code at line 1042 was first introduced by commit
> :::::: 6365bead25efc84a4cf4aa9b0a7638f8a970cdff DMA: sa11x0: add SA-11x0
> DMA driver
>
> :::::: TO: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
> :::::: CC: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx