summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2022-01-21 11:59:20 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2022-06-20 14:42:42 +0000
commitae5a8bed14db6c16225cac733ea042c27e242d18 (patch)
tree6cb338e500e944f951e8ba0fab16598f6ecdc8cb
parenta196c3ffe35a9a1589267b660ce6c2ff2ccab5e9 (diff)
downloadillumos-joyent-ae5a8bed14db6c16225cac733ea042c27e242d18.tar.gz
14422 gcc10 build does not remove unused static functions
Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Rich Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/common/mc/mc-amd/mcamd_patounum.c4
-rw-r--r--usr/src/uts/common/io/axf/axf_usbgem.c2
-rw-r--r--usr/src/uts/common/io/iwk/iwk2.c4
-rw-r--r--usr/src/uts/common/io/mem.c68
-rw-r--r--usr/src/uts/common/io/mwl/mwl.c2
-rw-r--r--usr/src/uts/common/io/nge/nge_chip.c5
-rw-r--r--usr/src/uts/common/io/pcic.c4
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c2
-rw-r--r--usr/src/uts/common/vm/seg_kmem.c11
-rw-r--r--usr/src/uts/i86pc/os/trap.c2
-rw-r--r--usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c2
11 files changed, 63 insertions, 43 deletions
diff --git a/usr/src/common/mc/mc-amd/mcamd_patounum.c b/usr/src/common/mc/mc-amd/mcamd_patounum.c
index 52ecce05e7..9811aae0c2 100644
--- a/usr/src/common/mc/mc-amd/mcamd_patounum.c
+++ b/usr/src/common/mc/mc-amd/mcamd_patounum.c
@@ -22,8 +22,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Given a physical address and an optional syndrome, determine the
* name of the memory module that contains it.
@@ -435,6 +433,7 @@ mc_whichdimm(struct mcamd_hdl *hdl, mcamd_node_t *cs, uint64_t pa,
}
}
+#ifdef DEBUG
/*
* Brute-force BKDG pa to cs translation, coded to look as much like the
* BKDG code as possible.
@@ -599,6 +598,7 @@ mc_bkdg_patounum(struct mcamd_hdl *hdl, mcamd_node_t *mc, uint64_t pa,
return (mcamd_set_errno(hdl, EMCAMD_NOADDR));
}
+#endif /* DEBUG */
/*
* Called for each memory controller to see if the given address is
diff --git a/usr/src/uts/common/io/axf/axf_usbgem.c b/usr/src/uts/common/io/axf/axf_usbgem.c
index 2b1bc4f2e7..555aecd21b 100644
--- a/usr/src/uts/common/io/axf/axf_usbgem.c
+++ b/usr/src/uts/common/io/axf/axf_usbgem.c
@@ -791,6 +791,7 @@ axf_tx_make_packet(struct usbgem_dev *dp, mblk_t *mp)
return (new);
}
+#if DEBUG_LEVEL > 10
static void
axf_dump_packet(struct usbgem_dev *dp, uint8_t *bp, int n)
{
@@ -801,6 +802,7 @@ axf_dump_packet(struct usbgem_dev *dp, uint8_t *bp, int n)
bp[0], bp[1], bp[2], bp[3], bp[4], bp[5], bp[6], bp[7]);
}
}
+#endif
static mblk_t *
axf_rx_make_packet(struct usbgem_dev *dp, mblk_t *mp)
diff --git a/usr/src/uts/common/io/iwk/iwk2.c b/usr/src/uts/common/io/iwk/iwk2.c
index 6b5c64363c..b0025ad662 100644
--- a/usr/src/uts/common/io/iwk/iwk2.c
+++ b/usr/src/uts/common/io/iwk/iwk2.c
@@ -335,7 +335,7 @@ static void iwk_m_stop(void *arg);
static int iwk_m_unicst(void *arg, const uint8_t *macaddr);
static int iwk_m_multicst(void *arg, boolean_t add, const uint8_t *m);
static int iwk_m_promisc(void *arg, boolean_t on);
-static mblk_t *iwk_m_tx(void *arg, mblk_t *mp);
+static mblk_t *iwk_m_tx(void *arg, mblk_t *mp);
static void iwk_m_ioctl(void *arg, queue_t *wq, mblk_t *mp);
static int iwk_m_setprop(void *arg, const char *pr_name,
mac_prop_id_t wldp_pr_name, uint_t wldp_length, const void *wldp_buf);
@@ -5919,6 +5919,7 @@ static void iwk_recv_mgmt(struct ieee80211com *ic, mblk_t *mp,
mutex_exit(&sc->sc_glock);
}
+#ifdef DEBUG
/*
* 1) log_event_table_ptr indicates base of the event log. This traces
* a 256-entry history of uCode execution within a circular buffer.
@@ -6103,6 +6104,7 @@ static void iwk_write_error_log(iwk_sc_t *sc)
iwk_mac_access_exit(sc);
}
+#endif /* DEBUG */
static int
iwk_run_state_config_ibss(ieee80211com_t *ic)
diff --git a/usr/src/uts/common/io/mem.c b/usr/src/uts/common/io/mem.c
index 96262bfe1a..cde4fab94f 100644
--- a/usr/src/uts/common/io/mem.c
+++ b/usr/src/uts/common/io/mem.c
@@ -99,8 +99,6 @@ static int mm_kmem_io_access;
static int mm_kstat_update(kstat_t *ksp, int rw);
static int mm_kstat_snapshot(kstat_t *ksp, void *buf, int rw);
-static int mm_read_mem_name(intptr_t data, mem_name_t *mem_name);
-
#define MM_KMEMLOG_NENTRIES 64
static int mm_kmemlogent;
@@ -335,6 +333,8 @@ mmio(struct uio *uio, enum uio_rw rw, pfn_t pfn, off_t pageoff, int allowio,
return (error);
}
+#ifdef __sparc
+
static int
mmpagelock(struct as *as, caddr_t va)
{
@@ -349,8 +349,6 @@ mmpagelock(struct as *as, caddr_t va)
return (i);
}
-#ifdef __sparc
-
#define NEED_LOCK_KVADDR(kva) mmpagelock(&kas, kva)
#else
@@ -642,6 +640,37 @@ mmioctl_page_retire(int cmd, intptr_t data)
#ifdef __sparc
/*
+ * Read a mem_name_t from user-space and store it in the mem_name_t
+ * pointed to by the mem_name argument.
+ */
+static int
+mm_read_mem_name(intptr_t data, mem_name_t *mem_name)
+{
+ if (get_udatamodel() == DATAMODEL_NATIVE) {
+ if (copyin((void *)data, mem_name, sizeof (mem_name_t)))
+ return (EFAULT);
+ }
+#ifdef _SYSCALL32
+ else {
+ mem_name32_t mem_name32;
+
+ if (copyin((void *)data, &mem_name32, sizeof (mem_name32_t)))
+ return (EFAULT);
+ mem_name->m_addr = mem_name32.m_addr;
+ mem_name->m_synd = mem_name32.m_synd;
+ mem_name->m_type[0] = mem_name32.m_type[0];
+ mem_name->m_type[1] = mem_name32.m_type[1];
+ mem_name->m_name = (caddr_t)(uintptr_t)mem_name32.m_name;
+ mem_name->m_namelen = (size_t)mem_name32.m_namelen;
+ mem_name->m_sid = (caddr_t)(uintptr_t)mem_name32.m_sid;
+ mem_name->m_sidlen = (size_t)mem_name32.m_sidlen;
+ }
+#endif /* _SYSCALL32 */
+
+ return (0);
+}
+
+/*
* Given a syndrome, syndrome type, and address return the
* associated memory name in the provided data buffer.
*/
@@ -1086,34 +1115,3 @@ mm_kstat_snapshot(kstat_t *ksp, void *buf, int rw)
return (0);
}
-
-/*
- * Read a mem_name_t from user-space and store it in the mem_name_t
- * pointed to by the mem_name argument.
- */
-static int
-mm_read_mem_name(intptr_t data, mem_name_t *mem_name)
-{
- if (get_udatamodel() == DATAMODEL_NATIVE) {
- if (copyin((void *)data, mem_name, sizeof (mem_name_t)))
- return (EFAULT);
- }
-#ifdef _SYSCALL32
- else {
- mem_name32_t mem_name32;
-
- if (copyin((void *)data, &mem_name32, sizeof (mem_name32_t)))
- return (EFAULT);
- mem_name->m_addr = mem_name32.m_addr;
- mem_name->m_synd = mem_name32.m_synd;
- mem_name->m_type[0] = mem_name32.m_type[0];
- mem_name->m_type[1] = mem_name32.m_type[1];
- mem_name->m_name = (caddr_t)(uintptr_t)mem_name32.m_name;
- mem_name->m_namelen = (size_t)mem_name32.m_namelen;
- mem_name->m_sid = (caddr_t)(uintptr_t)mem_name32.m_sid;
- mem_name->m_sidlen = (size_t)mem_name32.m_sidlen;
- }
-#endif /* _SYSCALL32 */
-
- return (0);
-}
diff --git a/usr/src/uts/common/io/mwl/mwl.c b/usr/src/uts/common/io/mwl/mwl.c
index 114b32eeab..6b23d49802 100644
--- a/usr/src/uts/common/io/mwl/mwl.c
+++ b/usr/src/uts/common/io/mwl/mwl.c
@@ -1196,6 +1196,7 @@ mwlWaitForCmdComplete(struct mwl_softc *sc, uint16_t cmdCode)
#undef MAX_WAIT_FW_COMPLETE_ITERATIONS
}
+#ifdef DEBUG
static const char *
mwlcmdname(int cmd)
{
@@ -1255,6 +1256,7 @@ mwlcmdname(int cmd)
return (buf);
#undef CMD
}
+#endif /* DEBUG */
static void
dumpresult(struct mwl_softc *sc, int showresult)
diff --git a/usr/src/uts/common/io/nge/nge_chip.c b/usr/src/uts/common/io/nge/nge_chip.c
index 0bef9ff505..b10346e3b0 100644
--- a/usr/src/uts/common/io/nge/nge_chip.c
+++ b/usr/src/uts/common/io/nge/nge_chip.c
@@ -107,7 +107,7 @@ nge_reg_put32(nge_t *ngep, nge_regno_t regno, uint32_t data)
}
-
+#if NGE_DEBUGGING
static int nge_chip_peek_cfg(nge_t *ngep, nge_peekpoke_t *ppd);
#pragma no_inline(nge_chip_peek_cfg)
@@ -426,6 +426,7 @@ nge_chip_poke_seeprom(nge_t *ngep, nge_peekpoke_t *ppd)
ppd->pp_acc_offset, &data);
return (err);
}
+#endif /* NGE_DEBUGGING */
void
nge_init_dev_spec_param(nge_t *ngep)
@@ -1846,6 +1847,7 @@ nge_chip_intr(caddr_t arg1, caddr_t arg2)
return (DDI_INTR_CLAIMED);
}
+#if NGE_DEBUGGING
static enum ioc_reply
nge_pp_ioctl(nge_t *ngep, int cmd, mblk_t *mp, struct iocblk *iocp)
{
@@ -1985,6 +1987,7 @@ nge_diag_ioctl(nge_t *ngep, int cmd, mblk_t *mp, struct iocblk *iocp)
/* NOTREACHED */
}
+#endif /* NGE_DEBUGGING */
enum ioc_reply
nge_chip_ioctl(nge_t *ngep, mblk_t *mp, struct iocblk *iocp)
diff --git a/usr/src/uts/common/io/pcic.c b/usr/src/uts/common/io/pcic.c
index ef9ad9059d..e3764bcc14 100644
--- a/usr/src/uts/common/io/pcic.c
+++ b/usr/src/uts/common/io/pcic.c
@@ -6333,6 +6333,7 @@ pcic_cb_disable_intr(dev_info_t *dip)
mutex_exit(&pcic->pc_lock);
}
+#if defined(__sparc)
static int
log_pci_cfg_err(ushort_t e, int bridge_secondary)
{
@@ -6363,7 +6364,6 @@ log_pci_cfg_err(ushort_t e, int bridge_secondary)
return (nerr);
}
-#if defined(__sparc)
static int
pcic_fault(enum pci_fault_ops op, void *arg)
{
@@ -6786,6 +6786,7 @@ pcic_cbus_powerctl(pcicdev_t *pcic, int socket)
static int pcic_do_pprintf = 0;
+#ifdef PCIC_DEBUG
static void
pcic_dump_debqueue(char *msg)
{
@@ -6802,6 +6803,7 @@ pcic_dump_debqueue(char *msg)
debp = debp->next;
}
}
+#endif /* PCIC_DEBUG */
/* PRINTFLIKE3 */
diff --git a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c
index a3b22a9adc..eac5daca8d 100644
--- a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c
+++ b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c
@@ -2668,7 +2668,7 @@ pmcs_find_phy_needing_work(pmcs_hw_t *pwp, pmcs_phy_t *pptr)
return (NULL);
}
-#endif
+#endif /* DEBUG */
/*
* We may (or may not) report observations to SCSA. This is prefaced by
diff --git a/usr/src/uts/common/vm/seg_kmem.c b/usr/src/uts/common/vm/seg_kmem.c
index 0bab4eb76d..098b960f2a 100644
--- a/usr/src/uts/common/vm/seg_kmem.c
+++ b/usr/src/uts/common/vm/seg_kmem.c
@@ -145,16 +145,19 @@ struct seg kvmmseg; /* Segment for vmm memory */
*/
size_t segkmem_lpsize;
-static uint_t segkmem_lpshift = PAGESHIFT;
int segkmem_lpszc = 0;
size_t segkmem_kmemlp_quantum = 0x400000; /* 4MB */
size_t segkmem_heaplp_quantum;
vmem_t *heap_lp_arena;
static vmem_t *kmem_lp_arena;
-static vmem_t *segkmem_ppa_arena;
static segkmem_lpcb_t segkmem_lpcb;
+#ifdef __sparc
+static uint_t segkmem_lpshift = PAGESHIFT;
+static vmem_t *segkmem_ppa_arena;
+#endif
+
/*
* We use "segkmem_kmemlp_max" to limit the total amount of physical memory
* consumed by the large page heap. By default this parameter is set to 1/8 of
@@ -1097,6 +1100,7 @@ kmem_freepages(void *addr, pgcnt_t npages)
kmem_free(addr, ptob(npages));
}
+#ifdef __sparc
/*
* segkmem_page_create_large() allocates a large page to be used for the kmem
* caches. If kpr is enabled we ask for a relocatable page unless requested
@@ -1243,6 +1247,7 @@ segkmem_free_one_lp(caddr_t addr, size_t size)
/* page_unresv() is done by the caller */
}
+#endif /* __sparc */
/*
* This function is called to import new spans into the vmem arenas like
@@ -1387,6 +1392,7 @@ segkmem_free_lp(vmem_t *vmp, void *inaddr, size_t size)
}
}
+#ifdef __sparc
/*
* segkmem_alloc_lpi() imports virtual memory from large page heap arena
* into kmem_lp arena. In the process it maps the imported segment with
@@ -1439,6 +1445,7 @@ segkmem_free_lpi(vmem_t *vmp, void *inaddr, size_t size)
vmem_free(vmp, inaddr, size);
}
+#endif /* __sparc */
/*
* This function is called at system boot time by kmem_init right after
diff --git a/usr/src/uts/i86pc/os/trap.c b/usr/src/uts/i86pc/os/trap.c
index 6c85fcb135..7355e41688 100644
--- a/usr/src/uts/i86pc/os/trap.c
+++ b/usr/src/uts/i86pc/os/trap.c
@@ -283,6 +283,7 @@ instr_is_other_syscall(caddr_t pc, int which)
return (0);
}
+#ifdef DEBUG
static const char *
syscall_insn_string(int syscall_insn)
{
@@ -297,6 +298,7 @@ syscall_insn_string(int syscall_insn)
return ("Unknown");
}
}
+#endif /* DEBUG */
static int
ldt_rewrite_syscall(struct regs *rp, proc_t *p, int syscall_insn)
diff --git a/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c b/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c
index 3f890d8f07..468da22085 100644
--- a/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c
+++ b/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c
@@ -2448,6 +2448,7 @@ pcicfg_get_pf_mem(pcicfg_phdl_t *entry, uint32_t length, uint64_t *ans)
length, ddi_get_name(entry->dip));
}
+#ifdef __sparc
static int
pcicfg_sum_resources(dev_info_t *dip, void *hdl)
{
@@ -2580,6 +2581,7 @@ pcicfg_sum_resources(dev_info_t *dip, void *hdl)
return (DDI_WALK_CONTINUE);
}
}
+#endif /* __sparc */
static int
pcicfg_free_bridge_resources(dev_info_t *dip)