Re: [PATCH] mmc: rtsx: Fix build errors/warnings for unused variable

From: kernel test robot
Date: Tue Mar 01 2022 - 10:45:41 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: ia64-allmodconfig (https://download.01.org/0day-ci/archive/20220301/202203012355.ehZZyZBe-lkp@xxxxxxxxx/config)
compiler: ia64-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://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=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 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: In function 'sd_request':
>> drivers/mmc/host/rtsx_pci_sdmmc.c:825:29: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
825 | pm_runtime_get_sync(dev);
| ^~~
| cdev
drivers/mmc/host/rtsx_pci_sdmmc.c:825:29: note: each undeclared identifier is reported only once for each function it appears in
drivers/mmc/host/rtsx_pci_sdmmc.c: In function 'sdmmc_set_ios':
drivers/mmc/host/rtsx_pci_sdmmc.c:1094:29: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
1094 | pm_runtime_get_sync(dev);
| ^~~
| cdev
drivers/mmc/host/rtsx_pci_sdmmc.c: In function 'sdmmc_get_ro':
drivers/mmc/host/rtsx_pci_sdmmc.c:1144:29: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
1144 | pm_runtime_get_sync(dev);
| ^~~
| cdev
drivers/mmc/host/rtsx_pci_sdmmc.c: In function 'sdmmc_get_cd':
drivers/mmc/host/rtsx_pci_sdmmc.c:1172:29: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
1172 | pm_runtime_get_sync(dev);
| ^~~
| cdev
drivers/mmc/host/rtsx_pci_sdmmc.c: In function 'sdmmc_switch_voltage':
drivers/mmc/host/rtsx_pci_sdmmc.c:1280:29: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
1280 | pm_runtime_get_sync(dev);
| ^~~
| cdev
drivers/mmc/host/rtsx_pci_sdmmc.c: In function 'sdmmc_execute_tuning':
drivers/mmc/host/rtsx_pci_sdmmc.c:1331:29: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
1331 | pm_runtime_get_sync(dev);
| ^~~
| cdev


vim +825 drivers/mmc/host/rtsx_pci_sdmmc.c

6291e7153a173f8 Micky Ching 2014-06-06 798
6291e7153a173f8 Micky Ching 2014-06-06 799 static void sd_request(struct work_struct *work)
6291e7153a173f8 Micky Ching 2014-06-06 800 {
6291e7153a173f8 Micky Ching 2014-06-06 801 struct realtek_pci_sdmmc *host = container_of(work,
6291e7153a173f8 Micky Ching 2014-06-06 802 struct realtek_pci_sdmmc, work);
ff984e57d36e8ac Wei WANG 2012-10-29 803 struct rtsx_pcr *pcr = host->pcr;
6291e7153a173f8 Micky Ching 2014-06-06 804
6291e7153a173f8 Micky Ching 2014-06-06 805 struct mmc_host *mmc = host->mmc;
6291e7153a173f8 Micky Ching 2014-06-06 806 struct mmc_request *mrq = host->mrq;
ff984e57d36e8ac Wei WANG 2012-10-29 807 struct mmc_command *cmd = mrq->cmd;
ff984e57d36e8ac Wei WANG 2012-10-29 808 struct mmc_data *data = mrq->data;
6291e7153a173f8 Micky Ching 2014-06-06 809
ff984e57d36e8ac Wei WANG 2012-10-29 810 unsigned int data_size = 0;
c3481955f6c78c8 Wei WANG 2013-02-08 811 int err;
ff984e57d36e8ac Wei WANG 2012-10-29 812
b22217f966f585b Micky Ching 2015-01-14 813 if (host->eject || !sd_get_cd_int(host)) {
ff984e57d36e8ac Wei WANG 2012-10-29 814 cmd->error = -ENOMEDIUM;
ff984e57d36e8ac Wei WANG 2012-10-29 815 goto finish;
ff984e57d36e8ac Wei WANG 2012-10-29 816 }
ff984e57d36e8ac Wei WANG 2012-10-29 817
c3481955f6c78c8 Wei WANG 2013-02-08 818 err = rtsx_pci_card_exclusive_check(host->pcr, RTSX_SD_CARD);
c3481955f6c78c8 Wei WANG 2013-02-08 819 if (err) {
c3481955f6c78c8 Wei WANG 2013-02-08 820 cmd->error = err;
c3481955f6c78c8 Wei WANG 2013-02-08 821 goto finish;
c3481955f6c78c8 Wei WANG 2013-02-08 822 }
c3481955f6c78c8 Wei WANG 2013-02-08 823
98fcc5762dcecbb Micky Ching 2014-04-29 824 mutex_lock(&pcr->pcr_mutex);
7499b529d97f752 Kai-Heng Feng 2022-01-25 @825 pm_runtime_get_sync(dev);
98fcc5762dcecbb Micky Ching 2014-04-29 826
ff984e57d36e8ac Wei WANG 2012-10-29 827 rtsx_pci_start_run(pcr);
ff984e57d36e8ac Wei WANG 2012-10-29 828
ff984e57d36e8ac Wei WANG 2012-10-29 829 rtsx_pci_switch_clock(pcr, host->clock, host->ssc_depth,
ff984e57d36e8ac Wei WANG 2012-10-29 830 host->initial_mode, host->double_clk, host->vpclk);
ff984e57d36e8ac Wei WANG 2012-10-29 831 rtsx_pci_write_register(pcr, CARD_SELECT, 0x07, SD_MOD_SEL);
ff984e57d36e8ac Wei WANG 2012-10-29 832 rtsx_pci_write_register(pcr, CARD_SHARE_MODE,
ff984e57d36e8ac Wei WANG 2012-10-29 833 CARD_SHARE_MASK, CARD_SHARE_48_SD);
ff984e57d36e8ac Wei WANG 2012-10-29 834
98fcc5762dcecbb Micky Ching 2014-04-29 835 mutex_lock(&host->host_mutex);
98fcc5762dcecbb Micky Ching 2014-04-29 836 host->mrq = mrq;
98fcc5762dcecbb Micky Ching 2014-04-29 837 mutex_unlock(&host->host_mutex);
98fcc5762dcecbb Micky Ching 2014-04-29 838
ff984e57d36e8ac Wei WANG 2012-10-29 839 if (mrq->data)
ff984e57d36e8ac Wei WANG 2012-10-29 840 data_size = data->blocks * data->blksz;
ff984e57d36e8ac Wei WANG 2012-10-29 841
1dcb35799e8fb58 Micky Ching 2014-12-23 842 if (!data_size) {
98fcc5762dcecbb Micky Ching 2014-04-29 843 sd_send_cmd_get_rsp(host, cmd);
1dcb35799e8fb58 Micky Ching 2014-12-23 844 } else if (sd_rw_cmd(cmd) || sdio_extblock_cmd(cmd, data)) {
1dcb35799e8fb58 Micky Ching 2014-12-23 845 cmd->error = sd_rw_multi(host, mrq);
6291e7153a173f8 Micky Ching 2014-06-06 846 if (!host->using_cookie)
6291e7153a173f8 Micky Ching 2014-06-06 847 sdmmc_post_req(host->mmc, host->mrq, 0);
98fcc5762dcecbb Micky Ching 2014-04-29 848
98fcc5762dcecbb Micky Ching 2014-04-29 849 if (mmc_op_multi(cmd->opcode) && mrq->stop)
98fcc5762dcecbb Micky Ching 2014-04-29 850 sd_send_cmd_get_rsp(host, mrq->stop);
ff984e57d36e8ac Wei WANG 2012-10-29 851 } else {
ff984e57d36e8ac Wei WANG 2012-10-29 852 sd_normal_rw(host, mrq);
ff984e57d36e8ac Wei WANG 2012-10-29 853 }
98fcc5762dcecbb Micky Ching 2014-04-29 854
98fcc5762dcecbb Micky Ching 2014-04-29 855 if (mrq->data) {
98fcc5762dcecbb Micky Ching 2014-04-29 856 if (cmd->error || data->error)
98fcc5762dcecbb Micky Ching 2014-04-29 857 data->bytes_xfered = 0;
98fcc5762dcecbb Micky Ching 2014-04-29 858 else
98fcc5762dcecbb Micky Ching 2014-04-29 859 data->bytes_xfered = data->blocks * data->blksz;
98fcc5762dcecbb Micky Ching 2014-04-29 860 }
98fcc5762dcecbb Micky Ching 2014-04-29 861
7499b529d97f752 Kai-Heng Feng 2022-01-25 862 pm_runtime_mark_last_busy(dev);
7499b529d97f752 Kai-Heng Feng 2022-01-25 863 pm_runtime_put_autosuspend(dev);
98fcc5762dcecbb Micky Ching 2014-04-29 864 mutex_unlock(&pcr->pcr_mutex);
ff984e57d36e8ac Wei WANG 2012-10-29 865
ff984e57d36e8ac Wei WANG 2012-10-29 866 finish:
1dcb35799e8fb58 Micky Ching 2014-12-23 867 if (cmd->error) {
1dcb35799e8fb58 Micky Ching 2014-12-23 868 dev_dbg(sdmmc_dev(host), "CMD %d 0x%08x error(%d)\n",
1dcb35799e8fb58 Micky Ching 2014-12-23 869 cmd->opcode, cmd->arg, cmd->error);
1dcb35799e8fb58 Micky Ching 2014-12-23 870 }
98fcc5762dcecbb Micky Ching 2014-04-29 871
98fcc5762dcecbb Micky Ching 2014-04-29 872 mutex_lock(&host->host_mutex);
98fcc5762dcecbb Micky Ching 2014-04-29 873 host->mrq = NULL;
98fcc5762dcecbb Micky Ching 2014-04-29 874 mutex_unlock(&host->host_mutex);
98fcc5762dcecbb Micky Ching 2014-04-29 875
98fcc5762dcecbb Micky Ching 2014-04-29 876 mmc_request_done(mmc, mrq);
ff984e57d36e8ac Wei WANG 2012-10-29 877 }
ff984e57d36e8ac Wei WANG 2012-10-29 878

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx