From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [mcgrof-next:20210708-block-fixes-v2 44/89] drivers/block/swim.c:780:26: error: 'swd' undeclared
Date: Wed, 21 Jul 2021 07:25:24 +0800 [thread overview]
Message-ID: <202107210717.WFHty8k0-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5680 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210708-block-fixes-v2
head: db0174e39de7dc941f158ce53ee3af95b1635b62
commit: 7c4874d9d55df4c25a06b1c9004b1a29429a8f6b [44/89] block/swim: add a helper to remove disks
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 10.3.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/mcgrof/linux-next.git/commit/?id=7c4874d9d55df4c25a06b1c9004b1a29429a8f6b
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20210708-block-fixes-v2
git checkout 7c4874d9d55df4c25a06b1c9004b1a29429a8f6b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/block/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/block/swim.c: In function 'swim_del_disks':
>> drivers/block/swim.c:780:26: error: 'swd' undeclared (first use in this function)
780 | for (drive = 0; drive < swd->floppy_count; drive++) {
| ^~~
drivers/block/swim.c:780:26: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/block/swim.c:783:8: error: 'fw' undeclared (first use in this function); did you mean 'fs'?
783 | if (fw->registered)
| ^~
| fs
>> drivers/block/swim.c:787:7: error: used struct type value where scalar is required
787 | if (fs->tag_set)
| ^~
drivers/block/swim.c: In function 'swim_floppy_init':
drivers/block/swim.c:851:19: warning: statement with no effect [-Wunused-value]
851 | swd->unit[drive].registered true;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~
>> drivers/block/swim.c:851:30: error: expected ';' before 'true'
851 | swd->unit[drive].registered true;
| ^ ~~~~
| ;
vim +/swd +780 drivers/block/swim.c
774
775 static void swim_del_disks(void)
776 {
777 int drive;
778 struct floppy_state *fs;
779
> 780 for (drive = 0; drive < swd->floppy_count; drive++) {
781 fs = swd->unit[drive];
782 if (fs->disk) {
> 783 if (fw->registered)
784 del_gendisk(fs->disk);
785 blk_cleanup_disk(fs->disk);
786 }
> 787 if (fs->tag_set)
788 blk_mq_free_tag_set(&fs->tag_set);
789 }
790
791 unregister_blkdev(FLOPPY_MAJOR, "fd");
792 }
793
794 static int swim_floppy_init(struct swim_priv *swd)
795 {
796 int err;
797 int drive;
798 struct swim __iomem *base = swd->base;
799
800 /* scan floppy drives */
801
802 swim_drive(base, INTERNAL_DRIVE);
803 if (swim_readbit(base, DRIVE_PRESENT) &&
804 !swim_readbit(base, ONEMEG_DRIVE))
805 swim_add_floppy(swd, INTERNAL_DRIVE);
806 swim_drive(base, EXTERNAL_DRIVE);
807 if (swim_readbit(base, DRIVE_PRESENT) &&
808 !swim_readbit(base, ONEMEG_DRIVE))
809 swim_add_floppy(swd, EXTERNAL_DRIVE);
810
811 /* register floppy drives */
812
813 err = register_blkdev(FLOPPY_MAJOR, "fd");
814 if (err) {
815 printk(KERN_ERR "Unable to get major %d for SWIM floppy\n",
816 FLOPPY_MAJOR);
817 return -EBUSY;
818 }
819
820 spin_lock_init(&swd->lock);
821
822 for (drive = 0; drive < swd->floppy_count; drive++) {
823 err = blk_mq_alloc_sq_tag_set(&swd->unit[drive].tag_set,
824 &swim_mq_ops, 2, BLK_MQ_F_SHOULD_MERGE);
825 if (err)
826 goto exit_put_disks;
827
828 swd->unit[drive].disk =
829 blk_mq_alloc_disk(&swd->unit[drive].tag_set,
830 &swd->unit[drive]);
831 if (IS_ERR(swd->unit[drive].disk)) {
832 blk_mq_free_tag_set(&swd->unit[drive].tag_set);
833 err = PTR_ERR(swd->unit[drive].disk);
834 goto exit_put_disks;
835 }
836
837 swd->unit[drive].swd = swd;
838 }
839
840 for (drive = 0; drive < swd->floppy_count; drive++) {
841 swd->unit[drive].disk->flags = GENHD_FL_REMOVABLE;
842 swd->unit[drive].disk->major = FLOPPY_MAJOR;
843 swd->unit[drive].disk->first_minor = drive;
844 swd->unit[drive].disk->minors = 1;
845 sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive);
846 swd->unit[drive].disk->fops = &floppy_fops;
847 swd->unit[drive].disk->events = DISK_EVENT_MEDIA_CHANGE;
848 swd->unit[drive].disk->private_data = &swd->unit[drive];
849 set_capacity(swd->unit[drive].disk, 2880);
850 add_disk(swd->unit[drive].disk);
> 851 swd->unit[drive].registered true;
852 }
853
854 return 0;
855
856 exit_put_disks:
857 unregister_blkdev(FLOPPY_MAJOR, "fd");
858 do {
859 struct gendisk *disk = swd->unit[drive].disk;
860
861 if (!disk)
862 continue;
863 blk_cleanup_disk(disk);
864 blk_mq_free_tag_set(&swd->unit[drive].tag_set);
865 } while (drive--);
866 return err;
867 }
868
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 60801 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [mcgrof-next:20210708-block-fixes-v2 44/89] drivers/block/swim.c:780:26: error: 'swd' undeclared
Date: Wed, 21 Jul 2021 07:25:24 +0800 [thread overview]
Message-ID: <202107210717.WFHty8k0-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5534 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210708-block-fixes-v2
head: db0174e39de7dc941f158ce53ee3af95b1635b62
commit: 7c4874d9d55df4c25a06b1c9004b1a29429a8f6b [44/89] block/swim: add a helper to remove disks
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 10.3.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/mcgrof/linux-next.git/commit/?id=7c4874d9d55df4c25a06b1c9004b1a29429a8f6b
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20210708-block-fixes-v2
git checkout 7c4874d9d55df4c25a06b1c9004b1a29429a8f6b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/block/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/block/swim.c: In function 'swim_del_disks':
>> drivers/block/swim.c:780:26: error: 'swd' undeclared (first use in this function)
780 | for (drive = 0; drive < swd->floppy_count; drive++) {
| ^~~
drivers/block/swim.c:780:26: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/block/swim.c:783:8: error: 'fw' undeclared (first use in this function); did you mean 'fs'?
783 | if (fw->registered)
| ^~
| fs
>> drivers/block/swim.c:787:7: error: used struct type value where scalar is required
787 | if (fs->tag_set)
| ^~
drivers/block/swim.c: In function 'swim_floppy_init':
drivers/block/swim.c:851:19: warning: statement with no effect [-Wunused-value]
851 | swd->unit[drive].registered true;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~
>> drivers/block/swim.c:851:30: error: expected ';' before 'true'
851 | swd->unit[drive].registered true;
| ^ ~~~~
| ;
vim +/swd +780 drivers/block/swim.c
774
775 static void swim_del_disks(void)
776 {
777 int drive;
778 struct floppy_state *fs;
779
> 780 for (drive = 0; drive < swd->floppy_count; drive++) {
781 fs = swd->unit[drive];
782 if (fs->disk) {
> 783 if (fw->registered)
784 del_gendisk(fs->disk);
785 blk_cleanup_disk(fs->disk);
786 }
> 787 if (fs->tag_set)
788 blk_mq_free_tag_set(&fs->tag_set);
789 }
790
791 unregister_blkdev(FLOPPY_MAJOR, "fd");
792 }
793
794 static int swim_floppy_init(struct swim_priv *swd)
795 {
796 int err;
797 int drive;
798 struct swim __iomem *base = swd->base;
799
800 /* scan floppy drives */
801
802 swim_drive(base, INTERNAL_DRIVE);
803 if (swim_readbit(base, DRIVE_PRESENT) &&
804 !swim_readbit(base, ONEMEG_DRIVE))
805 swim_add_floppy(swd, INTERNAL_DRIVE);
806 swim_drive(base, EXTERNAL_DRIVE);
807 if (swim_readbit(base, DRIVE_PRESENT) &&
808 !swim_readbit(base, ONEMEG_DRIVE))
809 swim_add_floppy(swd, EXTERNAL_DRIVE);
810
811 /* register floppy drives */
812
813 err = register_blkdev(FLOPPY_MAJOR, "fd");
814 if (err) {
815 printk(KERN_ERR "Unable to get major %d for SWIM floppy\n",
816 FLOPPY_MAJOR);
817 return -EBUSY;
818 }
819
820 spin_lock_init(&swd->lock);
821
822 for (drive = 0; drive < swd->floppy_count; drive++) {
823 err = blk_mq_alloc_sq_tag_set(&swd->unit[drive].tag_set,
824 &swim_mq_ops, 2, BLK_MQ_F_SHOULD_MERGE);
825 if (err)
826 goto exit_put_disks;
827
828 swd->unit[drive].disk =
829 blk_mq_alloc_disk(&swd->unit[drive].tag_set,
830 &swd->unit[drive]);
831 if (IS_ERR(swd->unit[drive].disk)) {
832 blk_mq_free_tag_set(&swd->unit[drive].tag_set);
833 err = PTR_ERR(swd->unit[drive].disk);
834 goto exit_put_disks;
835 }
836
837 swd->unit[drive].swd = swd;
838 }
839
840 for (drive = 0; drive < swd->floppy_count; drive++) {
841 swd->unit[drive].disk->flags = GENHD_FL_REMOVABLE;
842 swd->unit[drive].disk->major = FLOPPY_MAJOR;
843 swd->unit[drive].disk->first_minor = drive;
844 swd->unit[drive].disk->minors = 1;
845 sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive);
846 swd->unit[drive].disk->fops = &floppy_fops;
847 swd->unit[drive].disk->events = DISK_EVENT_MEDIA_CHANGE;
848 swd->unit[drive].disk->private_data = &swd->unit[drive];
849 set_capacity(swd->unit[drive].disk, 2880);
850 add_disk(swd->unit[drive].disk);
> 851 swd->unit[drive].registered true;
852 }
853
854 return 0;
855
856 exit_put_disks:
857 unregister_blkdev(FLOPPY_MAJOR, "fd");
858 do {
859 struct gendisk *disk = swd->unit[drive].disk;
860
861 if (!disk)
862 continue;
863 blk_cleanup_disk(disk);
864 blk_mq_free_tag_set(&swd->unit[drive].tag_set);
865 } while (drive--);
866 return err;
867 }
868
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 60801 bytes --]
next reply other threads:[~2021-07-20 23:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-20 23:25 kernel test robot [this message]
2021-07-20 23:25 ` [mcgrof-next:20210708-block-fixes-v2 44/89] drivers/block/swim.c:780:26: error: 'swd' undeclared kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202107210717.WFHty8k0-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.