Re: [PATCH] mmc: rtsx: Fix build errors/warnings for unused variable
From: kernel test robot
Date: Tue Mar 01 2022 - 10:56:43 EST
Hi Ulf,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20220228]
[cannot apply to soc/for-next linux/master linus/master v5.17-rc6 v5.17-rc5 v5.17-rc4 v5.17-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Ulf-Hansson/mmc-rtsx-Fix-build-errors-warnings-for-unused-variable/20220301-195325
base: 6705cd745adbbeac6b13002c7a30060f7b2568a5
config: x86_64-randconfig-a005 (https://download.01.org/0day-ci/archive/20220301/202203012329.tsb96XPG-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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://github.com/0day-ci/linux/commit/392366d45e7f16e01727e7e82a08085301ca3de8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ulf-Hansson/mmc-rtsx-Fix-build-errors-warnings-for-unused-variable/20220301-195325
git checkout 392366d45e7f16e01727e7e82a08085301ca3de8
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/mmc/host/
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/mmc/host/rtsx_pci_sdmmc.c:825:22: error: use of undeclared identifier 'dev'
pm_runtime_get_sync(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:862:28: error: use of undeclared identifier 'dev'
pm_runtime_mark_last_busy(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:863:29: error: use of undeclared identifier 'dev'
pm_runtime_put_autosuspend(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1094:22: error: use of undeclared identifier 'dev'
pm_runtime_get_sync(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1128:28: error: use of undeclared identifier 'dev'
pm_runtime_mark_last_busy(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1129:29: error: use of undeclared identifier 'dev'
pm_runtime_put_autosuspend(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1144:22: error: use of undeclared identifier 'dev'
pm_runtime_get_sync(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1154:28: error: use of undeclared identifier 'dev'
pm_runtime_mark_last_busy(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1155:29: error: use of undeclared identifier 'dev'
pm_runtime_put_autosuspend(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1172:22: error: use of undeclared identifier 'dev'
pm_runtime_get_sync(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1182:28: error: use of undeclared identifier 'dev'
pm_runtime_mark_last_busy(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1183:29: error: use of undeclared identifier 'dev'
pm_runtime_put_autosuspend(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1280:22: error: use of undeclared identifier 'dev'
pm_runtime_get_sync(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1310:28: error: use of undeclared identifier 'dev'
pm_runtime_mark_last_busy(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1311:29: error: use of undeclared identifier 'dev'
pm_runtime_put_autosuspend(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1331:22: error: use of undeclared identifier 'dev'
pm_runtime_get_sync(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1364:28: error: use of undeclared identifier 'dev'
pm_runtime_mark_last_busy(dev);
^
drivers/mmc/host/rtsx_pci_sdmmc.c:1365:29: error: use of undeclared identifier 'dev'
pm_runtime_put_autosuspend(dev);
^
18 errors generated.
vim +/dev +825 drivers/mmc/host/rtsx_pci_sdmmc.c
6291e7153a173f Micky Ching 2014-06-06 798
6291e7153a173f Micky Ching 2014-06-06 799 static void sd_request(struct work_struct *work)
6291e7153a173f Micky Ching 2014-06-06 800 {
6291e7153a173f Micky Ching 2014-06-06 801 struct realtek_pci_sdmmc *host = container_of(work,
6291e7153a173f Micky Ching 2014-06-06 802 struct realtek_pci_sdmmc, work);
ff984e57d36e8a Wei WANG 2012-10-29 803 struct rtsx_pcr *pcr = host->pcr;
6291e7153a173f Micky Ching 2014-06-06 804
6291e7153a173f Micky Ching 2014-06-06 805 struct mmc_host *mmc = host->mmc;
6291e7153a173f Micky Ching 2014-06-06 806 struct mmc_request *mrq = host->mrq;
ff984e57d36e8a Wei WANG 2012-10-29 807 struct mmc_command *cmd = mrq->cmd;
ff984e57d36e8a Wei WANG 2012-10-29 808 struct mmc_data *data = mrq->data;
6291e7153a173f Micky Ching 2014-06-06 809
ff984e57d36e8a Wei WANG 2012-10-29 810 unsigned int data_size = 0;
c3481955f6c78c Wei WANG 2013-02-08 811 int err;
ff984e57d36e8a Wei WANG 2012-10-29 812
b22217f966f585 Micky Ching 2015-01-14 813 if (host->eject || !sd_get_cd_int(host)) {
ff984e57d36e8a Wei WANG 2012-10-29 814 cmd->error = -ENOMEDIUM;
ff984e57d36e8a Wei WANG 2012-10-29 815 goto finish;
ff984e57d36e8a Wei WANG 2012-10-29 816 }
ff984e57d36e8a Wei WANG 2012-10-29 817
c3481955f6c78c Wei WANG 2013-02-08 818 err = rtsx_pci_card_exclusive_check(host->pcr, RTSX_SD_CARD);
c3481955f6c78c Wei WANG 2013-02-08 819 if (err) {
c3481955f6c78c Wei WANG 2013-02-08 820 cmd->error = err;
c3481955f6c78c Wei WANG 2013-02-08 821 goto finish;
c3481955f6c78c Wei WANG 2013-02-08 822 }
c3481955f6c78c Wei WANG 2013-02-08 823
98fcc5762dcecb Micky Ching 2014-04-29 824 mutex_lock(&pcr->pcr_mutex);
7499b529d97f75 Kai-Heng Feng 2022-01-25 @825 pm_runtime_get_sync(dev);
98fcc5762dcecb Micky Ching 2014-04-29 826
ff984e57d36e8a Wei WANG 2012-10-29 827 rtsx_pci_start_run(pcr);
ff984e57d36e8a Wei WANG 2012-10-29 828
ff984e57d36e8a Wei WANG 2012-10-29 829 rtsx_pci_switch_clock(pcr, host->clock, host->ssc_depth,
ff984e57d36e8a Wei WANG 2012-10-29 830 host->initial_mode, host->double_clk, host->vpclk);
ff984e57d36e8a Wei WANG 2012-10-29 831 rtsx_pci_write_register(pcr, CARD_SELECT, 0x07, SD_MOD_SEL);
ff984e57d36e8a Wei WANG 2012-10-29 832 rtsx_pci_write_register(pcr, CARD_SHARE_MODE,
ff984e57d36e8a Wei WANG 2012-10-29 833 CARD_SHARE_MASK, CARD_SHARE_48_SD);
ff984e57d36e8a Wei WANG 2012-10-29 834
98fcc5762dcecb Micky Ching 2014-04-29 835 mutex_lock(&host->host_mutex);
98fcc5762dcecb Micky Ching 2014-04-29 836 host->mrq = mrq;
98fcc5762dcecb Micky Ching 2014-04-29 837 mutex_unlock(&host->host_mutex);
98fcc5762dcecb Micky Ching 2014-04-29 838
ff984e57d36e8a Wei WANG 2012-10-29 839 if (mrq->data)
ff984e57d36e8a Wei WANG 2012-10-29 840 data_size = data->blocks * data->blksz;
ff984e57d36e8a Wei WANG 2012-10-29 841
1dcb35799e8fb5 Micky Ching 2014-12-23 842 if (!data_size) {
98fcc5762dcecb Micky Ching 2014-04-29 843 sd_send_cmd_get_rsp(host, cmd);
1dcb35799e8fb5 Micky Ching 2014-12-23 844 } else if (sd_rw_cmd(cmd) || sdio_extblock_cmd(cmd, data)) {
1dcb35799e8fb5 Micky Ching 2014-12-23 845 cmd->error = sd_rw_multi(host, mrq);
6291e7153a173f Micky Ching 2014-06-06 846 if (!host->using_cookie)
6291e7153a173f Micky Ching 2014-06-06 847 sdmmc_post_req(host->mmc, host->mrq, 0);
98fcc5762dcecb Micky Ching 2014-04-29 848
98fcc5762dcecb Micky Ching 2014-04-29 849 if (mmc_op_multi(cmd->opcode) && mrq->stop)
98fcc5762dcecb Micky Ching 2014-04-29 850 sd_send_cmd_get_rsp(host, mrq->stop);
ff984e57d36e8a Wei WANG 2012-10-29 851 } else {
ff984e57d36e8a Wei WANG 2012-10-29 852 sd_normal_rw(host, mrq);
ff984e57d36e8a Wei WANG 2012-10-29 853 }
98fcc5762dcecb Micky Ching 2014-04-29 854
98fcc5762dcecb Micky Ching 2014-04-29 855 if (mrq->data) {
98fcc5762dcecb Micky Ching 2014-04-29 856 if (cmd->error || data->error)
98fcc5762dcecb Micky Ching 2014-04-29 857 data->bytes_xfered = 0;
98fcc5762dcecb Micky Ching 2014-04-29 858 else
98fcc5762dcecb Micky Ching 2014-04-29 859 data->bytes_xfered = data->blocks * data->blksz;
98fcc5762dcecb Micky Ching 2014-04-29 860 }
98fcc5762dcecb Micky Ching 2014-04-29 861
7499b529d97f75 Kai-Heng Feng 2022-01-25 862 pm_runtime_mark_last_busy(dev);
7499b529d97f75 Kai-Heng Feng 2022-01-25 863 pm_runtime_put_autosuspend(dev);
98fcc5762dcecb Micky Ching 2014-04-29 864 mutex_unlock(&pcr->pcr_mutex);
ff984e57d36e8a Wei WANG 2012-10-29 865
ff984e57d36e8a Wei WANG 2012-10-29 866 finish:
1dcb35799e8fb5 Micky Ching 2014-12-23 867 if (cmd->error) {
1dcb35799e8fb5 Micky Ching 2014-12-23 868 dev_dbg(sdmmc_dev(host), "CMD %d 0x%08x error(%d)\n",
1dcb35799e8fb5 Micky Ching 2014-12-23 869 cmd->opcode, cmd->arg, cmd->error);
1dcb35799e8fb5 Micky Ching 2014-12-23 870 }
98fcc5762dcecb Micky Ching 2014-04-29 871
98fcc5762dcecb Micky Ching 2014-04-29 872 mutex_lock(&host->host_mutex);
98fcc5762dcecb Micky Ching 2014-04-29 873 host->mrq = NULL;
98fcc5762dcecb Micky Ching 2014-04-29 874 mutex_unlock(&host->host_mutex);
98fcc5762dcecb Micky Ching 2014-04-29 875
98fcc5762dcecb Micky Ching 2014-04-29 876 mmc_request_done(mmc, mrq);
ff984e57d36e8a Wei WANG 2012-10-29 877 }
ff984e57d36e8a Wei WANG 2012-10-29 878
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx