From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Subject: [PATCH v2] scsi: remove several unused functions
Date: Sun, 14 Dec 2025 00:15:11 -0800 [thread overview]
Message-ID: <20251214081511.59634-1-enelsonmoore@gmail.com> (raw)
In-Reply-To: <20251211014246.38423-1-enelsonmoore@gmail.com>
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
drivers/scsi/aic7xxx/aic79xx_core.c | 89 ---------------------------
drivers/scsi/aic7xxx/aic79xx_inline.h | 10 ---
drivers/scsi/aic7xxx/aic79xx_osm.c | 16 -----
drivers/scsi/aic7xxx/aic7xxx_core.c | 35 -----------
drivers/scsi/nsp32.c | 19 ------
drivers/scsi/ses.c | 24 --------
6 files changed, 193 deletions(-)
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 6b87ea004e53..a6f1c23f5a38 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -659,28 +659,12 @@ ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr)
ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF);
}
-#if 0 /* unused */
-static u_int
-ahd_get_hnscb_qoff(struct ahd_softc *ahd)
-{
- return (ahd_inw_atomic(ahd, HNSCB_QOFF));
-}
-#endif
-
static void
ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value)
{
ahd_outw_atomic(ahd, HNSCB_QOFF, value);
}
-#if 0 /* unused */
-static u_int
-ahd_get_hescb_qoff(struct ahd_softc *ahd)
-{
- return (ahd_inb(ahd, HESCB_QOFF));
-}
-#endif
-
static void
ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value)
{
@@ -705,15 +689,6 @@ ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value)
ahd_outw(ahd, SNSCB_QOFF, value);
}
-#if 0 /* unused */
-static u_int
-ahd_get_sescb_qoff(struct ahd_softc *ahd)
-{
- AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
- return (ahd_inb(ahd, SESCB_QOFF));
-}
-#endif
-
static void
ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value)
{
@@ -721,15 +696,6 @@ ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value)
ahd_outb(ahd, SESCB_QOFF, value);
}
-#if 0 /* unused */
-static u_int
-ahd_get_sdscb_qoff(struct ahd_softc *ahd)
-{
- AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
- return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8));
-}
-#endif
-
static void
ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value)
{
@@ -3560,33 +3526,6 @@ ahd_clear_intstat(struct ahd_softc *ahd)
uint32_t ahd_debug = AHD_DEBUG_OPTS;
#endif
-#if 0
-void
-ahd_print_scb(struct scb *scb)
-{
- struct hardware_scb *hscb;
- int i;
-
- hscb = scb->hscb;
- printk("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n",
- (void *)scb,
- hscb->control,
- hscb->scsiid,
- hscb->lun,
- hscb->cdb_len);
- printk("Shared Data: ");
- for (i = 0; i < sizeof(hscb->shared_data.idata.cdb); i++)
- printk("%#02x", hscb->shared_data.idata.cdb[i]);
- printk(" dataptr:%#x%x datacnt:%#x sgptr:%#x tag:%#x\n",
- (uint32_t)((ahd_le64toh(hscb->dataptr) >> 32) & 0xFFFFFFFF),
- (uint32_t)(ahd_le64toh(hscb->dataptr) & 0xFFFFFFFF),
- ahd_le32toh(hscb->datacnt),
- ahd_le32toh(hscb->sgptr),
- SCB_GET_TAG(scb));
- ahd_dump_sglist(scb);
-}
-#endif /* 0 */
-
/************************* Transfer Negotiation *******************************/
/*
* Allocate per target mode instance (ID we respond to as a target)
@@ -9889,34 +9828,6 @@ ahd_dump_card_state(struct ahd_softc *ahd)
ahd_unpause(ahd);
}
-#if 0
-void
-ahd_dump_scbs(struct ahd_softc *ahd)
-{
- ahd_mode_state saved_modes;
- u_int saved_scb_index;
- int i;
-
- saved_modes = ahd_save_modes(ahd);
- ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
- saved_scb_index = ahd_get_scbptr(ahd);
- for (i = 0; i < AHD_SCB_MAX; i++) {
- ahd_set_scbptr(ahd, i);
- printk("%3d", i);
- printk("(CTRL 0x%x ID 0x%x N 0x%x N2 0x%x SG 0x%x, RSG 0x%x)\n",
- ahd_inb_scbram(ahd, SCB_CONTROL),
- ahd_inb_scbram(ahd, SCB_SCSIID),
- ahd_inw_scbram(ahd, SCB_NEXT),
- ahd_inw_scbram(ahd, SCB_NEXT2),
- ahd_inl_scbram(ahd, SCB_SGPTR),
- ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR));
- }
- printk("\n");
- ahd_set_scbptr(ahd, saved_scb_index);
- ahd_restore_modes(ahd, saved_modes);
-}
-#endif /* 0 */
-
/**************************** Flexport Logic **********************************/
/*
* Read count 16bit words from 16bit word address start_addr from the
diff --git a/drivers/scsi/aic7xxx/aic79xx_inline.h b/drivers/scsi/aic7xxx/aic79xx_inline.h
index 09335a3c8691..dca13159b2ce 100644
--- a/drivers/scsi/aic7xxx/aic79xx_inline.h
+++ b/drivers/scsi/aic7xxx/aic79xx_inline.h
@@ -144,16 +144,6 @@ static inline uint8_t *ahd_get_sense_buf(struct ahd_softc *ahd,
static inline uint32_t ahd_get_sense_bufaddr(struct ahd_softc *ahd,
struct scb *scb);
-#if 0 /* unused */
-
-#define AHD_COPY_COL_IDX(dst, src) \
-do { \
- dst->hscb->scsiid = src->hscb->scsiid; \
- dst->hscb->lun = src->hscb->lun; \
-} while (0)
-
-#endif
-
static inline uint8_t *
ahd_get_sense_buf(struct ahd_softc *ahd, struct scb *scb)
{
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index c3d1b9dd24ae..82a5c0d4e3f9 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -411,22 +411,6 @@ ahd_inb(struct ahd_softc * ahd, long port)
return (x);
}
-#if 0 /* unused */
-static uint16_t
-ahd_inw_atomic(struct ahd_softc * ahd, long port)
-{
- uint8_t x;
-
- if (ahd->tags[0] == BUS_SPACE_MEMIO) {
- x = readw(ahd->bshs[0].maddr + port);
- } else {
- x = inw(ahd->bshs[(port) >> 8].ioport + ((port) & 0xFF));
- }
- mb();
- return (x);
-}
-#endif
-
void
ahd_outb(struct ahd_softc * ahd, long port, uint8_t val)
{
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index a396f048a031..d55e2a321a7c 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -2072,41 +2072,6 @@ ahc_clear_intstat(struct ahc_softc *ahc)
uint32_t ahc_debug = AHC_DEBUG_OPTS;
#endif
-#if 0 /* unused */
-static void
-ahc_print_scb(struct scb *scb)
-{
- int i;
-
- struct hardware_scb *hscb = scb->hscb;
-
- printk("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n",
- (void *)scb,
- hscb->control,
- hscb->scsiid,
- hscb->lun,
- hscb->cdb_len);
- printk("Shared Data: ");
- for (i = 0; i < sizeof(hscb->shared_data.cdb); i++)
- printk("%#02x", hscb->shared_data.cdb[i]);
- printk(" dataptr:%#x datacnt:%#x sgptr:%#x tag:%#x\n",
- ahc_le32toh(hscb->dataptr),
- ahc_le32toh(hscb->datacnt),
- ahc_le32toh(hscb->sgptr),
- hscb->tag);
- if (scb->sg_count > 0) {
- for (i = 0; i < scb->sg_count; i++) {
- printk("sg[%d] - Addr 0x%x%x : Length %d\n",
- i,
- (ahc_le32toh(scb->sg_list[i].len) >> 24
- & SG_HIGH_ADDR_BITS),
- ahc_le32toh(scb->sg_list[i].addr),
- ahc_le32toh(scb->sg_list[i].len));
- }
- }
-}
-#endif
-
/************************* Transfer Negotiation *******************************/
/*
* Allocate per target mode instance (ID we respond to as a target)
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index abc4ce9eae74..c82b6a2026f1 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -424,25 +424,6 @@ static void nsp32_build_reject(struct scsi_cmnd *SCpnt)
data->msgout_len = pos;
}
-/*
- * timer
- */
-#if 0
-static void nsp32_start_timer(struct scsi_cmnd *SCpnt, int time)
-{
- unsigned int base = SCpnt->host->io_port;
-
- nsp32_dbg(NSP32_DEBUG_INTR, "timer=%d", time);
-
- if (time & (~TIMER_CNT_MASK)) {
- nsp32_dbg(NSP32_DEBUG_INTR, "timer set overflow");
- }
-
- nsp32_write2(base, TIMER_SET, time & TIMER_CNT_MASK);
-}
-#endif
-
-
/*
* set SCSI command and other parameter to asic, and start selection phase
*/
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 2c61624cb4b0..68f426cc3d6f 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -441,30 +441,6 @@ static struct enclosure_component_callbacks ses_enclosure_callbacks = {
.show_id = ses_show_id,
};
-struct ses_host_edev {
- struct Scsi_Host *shost;
- struct enclosure_device *edev;
-};
-
-#if 0
-int ses_match_host(struct enclosure_device *edev, void *data)
-{
- struct ses_host_edev *sed = data;
- struct scsi_device *sdev;
-
- if (!scsi_is_sdev_device(edev->edev.parent))
- return 0;
-
- sdev = to_scsi_device(edev->edev.parent);
-
- if (sdev->host != sed->shost)
- return 0;
-
- sed->edev = edev;
- return 1;
-}
-#endif /* 0 */
-
static int ses_process_descriptor(struct enclosure_component *ecomp,
unsigned char *desc, int max_desc_len)
{
--
2.43.0
prev parent reply other threads:[~2025-12-14 8:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-11 1:42 [PATCH] scsi: remove several unused functions Ethan Nelson-Moore
2025-12-11 1:42 ` [PATCH 1/2] scsi: sym53c8xx_2: remove conditional statements for constant macros Ethan Nelson-Moore
2025-12-11 6:55 ` [PATCH v2 1/2] scsi: sym53c8xx_2: remove code depending on non-default values of macros Ethan Nelson-Moore
2025-12-11 6:55 ` [PATCH v2 2/2] scsi: sym53c8xx_2: remove empty sym_init_tcb function Ethan Nelson-Moore
2025-12-11 1:42 ` [PATCH " Ethan Nelson-Moore
2025-12-14 8:15 ` Ethan Nelson-Moore [this message]
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=20251214081511.59634-1-enelsonmoore@gmail.com \
--to=enelsonmoore@gmail.com \
--cc=linux-scsi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox