* [pci:pci/sparc 3/8] arch/sparc/kernel/pcic.c:606:15: error: unused variable 'cmd'
@ 2018-05-22 1:32 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2018-05-22 1:32 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: kbuild-all, linux-pci
[-- Attachment #1: Type: text/plain, Size: 12756 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/sparc
head: bcc2b2c282ef2234b183d979f0cac647231b5ce2
commit: 9ff3917321751e017855194c4839fe0725251bd4 [3/8] sparc32/PCI/PCIC: Converge device enable path
config: sparc-defconfig (attached as .config)
compiler: sparc-linux-gcc (GCC) 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 9ff3917321751e017855194c4839fe0725251bd4
# save the attached .config to linux build tree
make.cross ARCH=sparc
All errors (new ones prefixed by >>):
arch/sparc/kernel/pcic.c: In function 'pcibios_fixup_bus':
>> arch/sparc/kernel/pcic.c:606:15: error: unused variable 'cmd' [-Werror=unused-variable]
unsigned int cmd = 0;
^~~
>> arch/sparc/kernel/pcic.c:605:17: error: unused variable 'has_mem' [-Werror=unused-variable]
int i, has_io, has_mem;
^~~~~~~
>> arch/sparc/kernel/pcic.c:605:9: error: unused variable 'has_io' [-Werror=unused-variable]
int i, has_io, has_mem;
^~~~~~
>> arch/sparc/kernel/pcic.c:605:6: error: unused variable 'i' [-Werror=unused-variable]
int i, has_io, has_mem;
^
arch/sparc/kernel/pcic.c: At top level:
>> arch/sparc/kernel/pcic.c:747:5: error: redefinition of 'pcibios_enable_device'
int pcibios_enable_device(struct pci_dev *pdev, int mask)
^~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/pcic.c:645:5: note: previous definition of 'pcibios_enable_device' was here
int pcibios_enable_device(struct pci_dev *dev, int mask)
^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/cmd +606 arch/sparc/kernel/pcic.c
^1da177e Linus Torvalds 2005-04-16 598
^1da177e Linus Torvalds 2005-04-16 599 /*
^1da177e Linus Torvalds 2005-04-16 600 * Normally called from {do_}pci_scan_bus...
^1da177e Linus Torvalds 2005-04-16 601 */
7c9503b8 Greg Kroah-Hartman 2012-12-21 602 void pcibios_fixup_bus(struct pci_bus *bus)
^1da177e Linus Torvalds 2005-04-16 603 {
^1da177e Linus Torvalds 2005-04-16 604 struct pci_dev *dev;
^1da177e Linus Torvalds 2005-04-16 @605 int i, has_io, has_mem;
2dc77533 Thomas Petazzoni 2017-08-13 @606 unsigned int cmd = 0;
^1da177e Linus Torvalds 2005-04-16 607 struct linux_pcic *pcic;
^1da177e Linus Torvalds 2005-04-16 608 /* struct linux_pbm_info* pbm = &pcic->pbm; */
^1da177e Linus Torvalds 2005-04-16 609 int node;
^1da177e Linus Torvalds 2005-04-16 610 struct pcidev_cookie *pcp;
^1da177e Linus Torvalds 2005-04-16 611
^1da177e Linus Torvalds 2005-04-16 612 if (!pcic0_up) {
^1da177e Linus Torvalds 2005-04-16 613 printk("pcibios_fixup_bus: no PCIC\n");
^1da177e Linus Torvalds 2005-04-16 614 return;
^1da177e Linus Torvalds 2005-04-16 615 }
^1da177e Linus Torvalds 2005-04-16 616 pcic = &pcic0;
^1da177e Linus Torvalds 2005-04-16 617
^1da177e Linus Torvalds 2005-04-16 618 /*
^1da177e Linus Torvalds 2005-04-16 619 * Next crud is an equivalent of pbm = pcic_bus_to_pbm(bus);
^1da177e Linus Torvalds 2005-04-16 620 */
^1da177e Linus Torvalds 2005-04-16 621 if (bus->number != 0) {
^1da177e Linus Torvalds 2005-04-16 622 printk("pcibios_fixup_bus: nonzero bus 0x%x\n", bus->number);
^1da177e Linus Torvalds 2005-04-16 623 return;
^1da177e Linus Torvalds 2005-04-16 624 }
^1da177e Linus Torvalds 2005-04-16 625
^1da177e Linus Torvalds 2005-04-16 626 list_for_each_entry(dev, &bus->devices, bus_list) {
^1da177e Linus Torvalds 2005-04-16 627 node = pdev_to_pnode(&pcic->pbm, dev);
^1da177e Linus Torvalds 2005-04-16 628 if(node == 0)
^1da177e Linus Torvalds 2005-04-16 629 node = -1;
^1da177e Linus Torvalds 2005-04-16 630
^1da177e Linus Torvalds 2005-04-16 631 /* cookies */
^1da177e Linus Torvalds 2005-04-16 632 pcp = pci_devcookie_alloc();
^1da177e Linus Torvalds 2005-04-16 633 pcp->pbm = &pcic->pbm;
942a6bdd David S. Miller 2006-06-23 634 pcp->prom_node = of_find_node_by_phandle(node);
^1da177e Linus Torvalds 2005-04-16 635 dev->sysdata = pcp;
^1da177e Linus Torvalds 2005-04-16 636
^1da177e Linus Torvalds 2005-04-16 637 /* fixing I/O to look like memory */
^1da177e Linus Torvalds 2005-04-16 638 if ((dev->class>>16) != PCI_BASE_CLASS_BRIDGE)
^1da177e Linus Torvalds 2005-04-16 639 pcic_map_pci_device(pcic, dev, node);
^1da177e Linus Torvalds 2005-04-16 640
^1da177e Linus Torvalds 2005-04-16 641 pcic_fill_irq(pcic, dev, node);
^1da177e Linus Torvalds 2005-04-16 642 }
^1da177e Linus Torvalds 2005-04-16 643 }
^1da177e Linus Torvalds 2005-04-16 644
9ff39173 Bjorn Helgaas 2018-05-21 645 int pcibios_enable_device(struct pci_dev *dev, int mask)
9ff39173 Bjorn Helgaas 2018-05-21 646 {
9ff39173 Bjorn Helgaas 2018-05-21 647 u16 cmd, oldcmd;
9ff39173 Bjorn Helgaas 2018-05-21 648 int i;
9ff39173 Bjorn Helgaas 2018-05-21 649
9ff39173 Bjorn Helgaas 2018-05-21 650 pci_read_config_word(dev, PCI_COMMAND, &cmd);
9ff39173 Bjorn Helgaas 2018-05-21 651 oldcmd = cmd;
9ff39173 Bjorn Helgaas 2018-05-21 652
9ff39173 Bjorn Helgaas 2018-05-21 653 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
9ff39173 Bjorn Helgaas 2018-05-21 654 struct resource *res = &dev->resource[i];
9ff39173 Bjorn Helgaas 2018-05-21 655
9ff39173 Bjorn Helgaas 2018-05-21 656 /* Only set up the requested stuff */
9ff39173 Bjorn Helgaas 2018-05-21 657 if (!(mask & (1<<i)))
9ff39173 Bjorn Helgaas 2018-05-21 658 continue;
9ff39173 Bjorn Helgaas 2018-05-21 659
9ff39173 Bjorn Helgaas 2018-05-21 660 if (res->flags & IORESOURCE_IO)
9ff39173 Bjorn Helgaas 2018-05-21 661 cmd |= PCI_COMMAND_IO;
9ff39173 Bjorn Helgaas 2018-05-21 662 if (res->flags & IORESOURCE_MEM)
9ff39173 Bjorn Helgaas 2018-05-21 663 cmd |= PCI_COMMAND_MEMORY;
9ff39173 Bjorn Helgaas 2018-05-21 664 }
9ff39173 Bjorn Helgaas 2018-05-21 665
9ff39173 Bjorn Helgaas 2018-05-21 666 if (cmd != oldcmd) {
9ff39173 Bjorn Helgaas 2018-05-21 667 printk(KERN_DEBUG "PCI: Enabling device: (%s), cmd %x\n",
9ff39173 Bjorn Helgaas 2018-05-21 668 pci_name(dev), cmd);
9ff39173 Bjorn Helgaas 2018-05-21 669 /* Enable the appropriate bits in the PCI command register. */
9ff39173 Bjorn Helgaas 2018-05-21 670 pci_write_config_word(dev, PCI_COMMAND, cmd);
9ff39173 Bjorn Helgaas 2018-05-21 671 }
9ff39173 Bjorn Helgaas 2018-05-21 672 return 0;
9ff39173 Bjorn Helgaas 2018-05-21 673 }
9ff39173 Bjorn Helgaas 2018-05-21 674
^1da177e Linus Torvalds 2005-04-16 675 /* Makes compiler happy */
^1da177e Linus Torvalds 2005-04-16 676 static volatile int pcic_timer_dummy;
^1da177e Linus Torvalds 2005-04-16 677
^1da177e Linus Torvalds 2005-04-16 678 static void pcic_clear_clock_irq(void)
^1da177e Linus Torvalds 2005-04-16 679 {
^1da177e Linus Torvalds 2005-04-16 680 pcic_timer_dummy = readl(pcic0.pcic_regs+PCI_SYS_LIMIT);
^1da177e Linus Torvalds 2005-04-16 681 }
^1da177e Linus Torvalds 2005-04-16 682
62f08283 Tkhai Kirill 2012-04-04 683 /* CPU frequency is 100 MHz, timer increments every 4 CPU clocks */
62f08283 Tkhai Kirill 2012-04-04 684 #define USECS_PER_JIFFY (1000000 / HZ)
62f08283 Tkhai Kirill 2012-04-04 685 #define TICK_TIMER_LIMIT ((100 * 1000000 / 4) / HZ)
62f08283 Tkhai Kirill 2012-04-04 686
62f08283 Tkhai Kirill 2012-04-04 687 static unsigned int pcic_cycles_offset(void)
^1da177e Linus Torvalds 2005-04-16 688 {
62f08283 Tkhai Kirill 2012-04-04 689 u32 value, count;
^1da177e Linus Torvalds 2005-04-16 690
62f08283 Tkhai Kirill 2012-04-04 691 value = readl(pcic0.pcic_regs + PCI_SYS_COUNTER);
62f08283 Tkhai Kirill 2012-04-04 692 count = value & ~PCI_SYS_COUNTER_OVERFLOW;
^1da177e Linus Torvalds 2005-04-16 693
62f08283 Tkhai Kirill 2012-04-04 694 if (value & PCI_SYS_COUNTER_OVERFLOW)
62f08283 Tkhai Kirill 2012-04-04 695 count += TICK_TIMER_LIMIT;
0299b137 John Stultz 2010-01-15 696 /*
62f08283 Tkhai Kirill 2012-04-04 697 * We divide all by HZ
0299b137 John Stultz 2010-01-15 698 * to have microsecond resolution and to avoid overflow
0299b137 John Stultz 2010-01-15 699 */
62f08283 Tkhai Kirill 2012-04-04 700 count = ((count / HZ) * USECS_PER_JIFFY) / (TICK_TIMER_LIMIT / HZ);
0299b137 John Stultz 2010-01-15 701
df2e7f52 Sam Ravnborg 2012-04-16 702 /* Coordinate with the sparc_config.clock_rate setting */
62f08283 Tkhai Kirill 2012-04-04 703 return count * 2;
62f08283 Tkhai Kirill 2012-04-04 704 }
0299b137 John Stultz 2010-01-15 705
^1da177e Linus Torvalds 2005-04-16 706 void __init pci_time_init(void)
^1da177e Linus Torvalds 2005-04-16 707 {
^1da177e Linus Torvalds 2005-04-16 708 struct linux_pcic *pcic = &pcic0;
^1da177e Linus Torvalds 2005-04-16 709 unsigned long v;
^1da177e Linus Torvalds 2005-04-16 710 int timer_irq, irq;
6baa9b20 Sam Ravnborg 2011-04-18 711 int err;
^1da177e Linus Torvalds 2005-04-16 712
62f08283 Tkhai Kirill 2012-04-04 713 #ifndef CONFIG_SMP
62f08283 Tkhai Kirill 2012-04-04 714 /*
df2e7f52 Sam Ravnborg 2012-04-16 715 * The clock_rate is in SBUS dimension.
62f08283 Tkhai Kirill 2012-04-04 716 * We take into account this in pcic_cycles_offset()
62f08283 Tkhai Kirill 2012-04-04 717 */
df2e7f52 Sam Ravnborg 2012-04-16 718 sparc_config.clock_rate = SBUS_CLOCK_RATE / HZ;
62f08283 Tkhai Kirill 2012-04-04 719 sparc_config.features |= FEAT_L10_CLOCKEVENT;
62f08283 Tkhai Kirill 2012-04-04 720 #endif
62f08283 Tkhai Kirill 2012-04-04 721 sparc_config.features |= FEAT_L10_CLOCKSOURCE;
62f08283 Tkhai Kirill 2012-04-04 722 sparc_config.get_cycles_offset = pcic_cycles_offset;
^1da177e Linus Torvalds 2005-04-16 723
^1da177e Linus Torvalds 2005-04-16 724 writel (TICK_TIMER_LIMIT, pcic->pcic_regs+PCI_SYS_LIMIT);
^1da177e Linus Torvalds 2005-04-16 725 /* PROM should set appropriate irq */
^1da177e Linus Torvalds 2005-04-16 726 v = readb(pcic->pcic_regs+PCI_COUNTER_IRQ);
^1da177e Linus Torvalds 2005-04-16 727 timer_irq = PCI_COUNTER_IRQ_SYS(v);
^1da177e Linus Torvalds 2005-04-16 728 writel (PCI_COUNTER_IRQ_SET(timer_irq, 0),
^1da177e Linus Torvalds 2005-04-16 729 pcic->pcic_regs+PCI_COUNTER_IRQ);
6baa9b20 Sam Ravnborg 2011-04-18 730 irq = pcic_build_device_irq(NULL, timer_irq);
62f08283 Tkhai Kirill 2012-04-04 731 err = request_irq(irq, timer_interrupt,
6baa9b20 Sam Ravnborg 2011-04-18 732 IRQF_TIMER, "timer", NULL);
6baa9b20 Sam Ravnborg 2011-04-18 733 if (err) {
^1da177e Linus Torvalds 2005-04-16 734 prom_printf("time_init: unable to attach IRQ%d\n", timer_irq);
^1da177e Linus Torvalds 2005-04-16 735 prom_halt();
^1da177e Linus Torvalds 2005-04-16 736 }
^1da177e Linus Torvalds 2005-04-16 737 local_irq_enable();
^1da177e Linus Torvalds 2005-04-16 738 }
^1da177e Linus Torvalds 2005-04-16 739
^1da177e Linus Torvalds 2005-04-16 740
^1da177e Linus Torvalds 2005-04-16 741 #if 0
^1da177e Linus Torvalds 2005-04-16 742 static void watchdog_reset() {
^1da177e Linus Torvalds 2005-04-16 743 writeb(0, pcic->pcic_regs+PCI_SYS_STATUS);
^1da177e Linus Torvalds 2005-04-16 744 }
^1da177e Linus Torvalds 2005-04-16 745 #endif
^1da177e Linus Torvalds 2005-04-16 746
^1da177e Linus Torvalds 2005-04-16 @747 int pcibios_enable_device(struct pci_dev *pdev, int mask)
^1da177e Linus Torvalds 2005-04-16 748 {
^1da177e Linus Torvalds 2005-04-16 749 return 0;
^1da177e Linus Torvalds 2005-04-16 750 }
^1da177e Linus Torvalds 2005-04-16 751
:::::: The code at line 606 was first introduced by commit
:::::: 2dc77533f1e495788d73ffa4bee4323b2646d2bb sparc: kernel/pcic: silence gcc 7.x warning in pcibios_fixup_bus()
:::::: TO: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 11531 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-05-22 1:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 1:32 [pci:pci/sparc 3/8] arch/sparc/kernel/pcic.c:606:15: error: unused variable 'cmd' kbuild test robot
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.