drivers/cdrom/gdrom.c:797:3: error: 'rc' undeclared

From: kbuild test robot
Date: Thu Oct 25 2018 - 02:21:49 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 01aa9d518eae8a4d75cd3049defc6ed0b6d0a658
commit: ad5fc6bb72214615f300af1f4ed57f71bc3be510 gdrom: convert to blk-mq
date: 9 days ago
config: sh-dreamcast_defconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout ad5fc6bb72214615f300af1f4ed57f71bc3be510
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=sh

All errors (new ones prefixed by >>):

drivers/cdrom/gdrom.c: In function 'probe_gdrom':
>> drivers/cdrom/gdrom.c:797:3: error: 'rc' undeclared (first use in this function)
rc = PTR_ERR(gd.gdrom_rq);
^~
drivers/cdrom/gdrom.c:797:3: note: each undeclared identifier is reported only once for each function it appears in

vim +/rc +797 drivers/cdrom/gdrom.c

749
750 /*
751 * register this as a block device and as compliant with the
752 * universal CD Rom driver interface
753 */
754 static int probe_gdrom(struct platform_device *devptr)
755 {
756 int err;
757 /* Start the device */
758 if (gdrom_execute_diagnostic() != 1) {
759 pr_warning("ATA Probe for GDROM failed\n");
760 return -ENODEV;
761 }
762 /* Print out firmware ID */
763 if (gdrom_outputversion())
764 return -ENOMEM;
765 /* Register GDROM */
766 gdrom_major = register_blkdev(0, GDROM_DEV_NAME);
767 if (gdrom_major <= 0)
768 return gdrom_major;
769 pr_info("Registered with major number %d\n",
770 gdrom_major);
771 /* Specify basic properties of drive */
772 gd.cd_info = kzalloc(sizeof(struct cdrom_device_info), GFP_KERNEL);
773 if (!gd.cd_info) {
774 err = -ENOMEM;
775 goto probe_fail_no_mem;
776 }
777 probe_gdrom_setupcd();
778 gd.disk = alloc_disk(1);
779 if (!gd.disk) {
780 err = -ENODEV;
781 goto probe_fail_no_disk;
782 }
783 probe_gdrom_setupdisk();
784 if (register_cdrom(gd.cd_info)) {
785 err = -ENODEV;
786 goto probe_fail_cdrom_register;
787 }
788 gd.disk->fops = &gdrom_bdops;
789 /* latch on to the interrupt */
790 err = gdrom_set_interrupt_handlers();
791 if (err)
792 goto probe_fail_cmdirq_register;
793
794 gd.gdrom_rq = blk_mq_init_sq_queue(&gd.tag_set, &gdrom_mq_ops, 1,
795 BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING);
796 if (IS_ERR(gd.gdrom_rq)) {
> 797 rc = PTR_ERR(gd.gdrom_rq);
798 gd.gdrom_rq = NULL;
799 goto probe_fail_requestq;
800 }
801
802 blk_queue_bounce_limit(gd.gdrom_rq, BLK_BOUNCE_HIGH);
803
804 err = probe_gdrom_setupqueue();
805 if (err)
806 goto probe_fail_toc;
807
808 gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL);
809 if (!gd.toc) {
810 err = -ENOMEM;
811 goto probe_fail_toc;
812 }
813 add_disk(gd.disk);
814 return 0;
815
816 probe_fail_toc:
817 blk_cleanup_queue(gd.gdrom_rq);
818 blk_mq_free_tag_set(&gd.tag_set);
819 probe_fail_requestq:
820 free_irq(HW_EVENT_GDROM_DMA, &gd);
821 free_irq(HW_EVENT_GDROM_CMD, &gd);
822 probe_fail_cmdirq_register:
823 probe_fail_cdrom_register:
824 del_gendisk(gd.disk);
825 probe_fail_no_disk:
826 kfree(gd.cd_info);
827 probe_fail_no_mem:
828 unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
829 gdrom_major = 0;
830 pr_warning("Probe failed - error is 0x%X\n", err);
831 return err;
832 }
833

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip