lkml.org 
[lkml]   [2021]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[mcgrof:20210816-add-disk-error-handling 28/64] drivers/block/swim.c:780:33: error: 'swd' undeclared
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git 20210816-add-disk-error-handling
head: e1e79332ea1bba0e751529b114ef9d301bf962a5
commit: 2d5d6d569c2bf06dc7b75a3557ec315435f3d78e [28/64] block/swim: add a helper to remove disks
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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/mcgrof/linux.git/commit/?id=2d5d6d569c2bf06dc7b75a3557ec315435f3d78e
git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
git fetch --no-tags mcgrof 20210816-add-disk-error-handling
git checkout 2d5d6d569c2bf06dc7b75a3557ec315435f3d78e
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.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:33: error: 'swd' undeclared (first use in this function)
780 | for (drive = 0; drive < swd->floppy_count; drive++) {
| ^~~
drivers/block/swim.c:780:33: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/block/swim.c:783:29: error: 'fw' undeclared (first use in this function); did you mean 'fs'?
783 | if (fw->registered)
| ^~
| fs
>> drivers/block/swim.c:787:21: 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:33: warning: statement with no effect [-Wunused-value]
851 | swd->unit[drive].registered true;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~
>> drivers/block/swim.c:851:44: 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
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-08-22 03:36    [W:1.299 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site