The branch main has been updated by scottl:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6ef1ad0dcfe8b0a0d95a571652d8c7183aa6a4e3

commit 6ef1ad0dcfe8b0a0d95a571652d8c7183aa6a4e3
Author:     Scott Long <[email protected]>
AuthorDate: 2021-11-25 02:41:18 +0000
Commit:     Scott Long <[email protected]>
CommitDate: 2021-11-25 02:41:18 +0000

    Fix "set but not used" warnings in mfi.  The one in mfi.c:mfi_data_cb()
    was a hidden but likely harmless mistake.  The rest were just old code
    that was OBE.
---
 sys/dev/mfi/mfi.c       | 4 +---
 sys/dev/mfi/mfi_cam.c   | 2 --
 sys/dev/mfi/mfi_disk.c  | 5 -----
 sys/dev/mfi/mfi_tbolt.c | 8 ++------
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 981f5a2673e5..0cf0bdb478af 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -2433,7 +2433,7 @@ mfi_data_cb(void *arg, bus_dma_segment_t *segs, int 
nsegs, int error)
         * least 1 frame, so don't compensate for the modulo of the
         * following division.
         */
-       cm->cm_total_frame_size += (sc->mfi_sge_size * nsegs);
+       cm->cm_total_frame_size += (sge_size * nsegs);
        cm->cm_extra_frames = (cm->cm_total_frame_size - 1) / MFI_FRAME_SIZE;
 
        if ((error = mfi_send_frame(sc, cm)) != 0) {
@@ -3108,7 +3108,6 @@ mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int 
flag, struct thread *td
        struct mfi_ioc_passthru iop_swab;
 #endif
        int error, locked;
-       union mfi_sgl *sgl;
        sc = dev->si_drv1;
        error = 0;
 
@@ -3200,7 +3199,6 @@ mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int 
flag, struct thread *td
                        cm->cm_sg =
                            (union mfi_sgl 
*)&cm->cm_frame->bytes[ioc->mfi_sgl_off];
                }
-               sgl = cm->cm_sg;
                cm->cm_flags = 0;
                if (cm->cm_frame->header.flags & MFI_FRAME_DATAIN)
                        cm->cm_flags |= MFI_CMD_DATAIN;
diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c
index 2ea27527e158..431dc7b4c129 100644
--- a/sys/dev/mfi/mfi_cam.c
+++ b/sys/dev/mfi/mfi_cam.c
@@ -406,10 +406,8 @@ mfip_done(struct mfi_command *cm)
        union ccb *ccb = cm->cm_private;
        struct ccb_hdr *ccbh = &ccb->ccb_h;
        struct ccb_scsiio *csio = &ccb->csio;
-       struct mfip_softc *sc;
        struct mfi_pass_frame *pt;
 
-       sc = ccbh->ccb_mfip_ptr;
        pt = &cm->cm_frame->pass;
 
        switch (pt->header.cmd_status) {
diff --git a/sys/dev/mfi/mfi_disk.c b/sys/dev/mfi/mfi_disk.c
index 016d3f99e9ad..e1f1420d5676 100644
--- a/sys/dev/mfi/mfi_disk.c
+++ b/sys/dev/mfi/mfi_disk.c
@@ -304,11 +304,6 @@ mfi_disk_strategy(struct bio *bio)
 void
 mfi_disk_complete(struct bio *bio)
 {
-       struct mfi_disk *sc;
-       struct mfi_frame_header *hdr;
-
-       sc = bio->bio_disk->d_drv1;
-       hdr = bio->bio_driver1;
 
        if (bio->bio_flags & BIO_ERROR) {
                bio->bio_resid = bio->bio_bcount;
diff --git a/sys/dev/mfi/mfi_tbolt.c b/sys/dev/mfi/mfi_tbolt.c
index f9eaf16912c3..0d2088f3a0a7 100644
--- a/sys/dev/mfi/mfi_tbolt.c
+++ b/sys/dev/mfi/mfi_tbolt.c
@@ -660,7 +660,6 @@ mfi_tbolt_complete_cmd(struct mfi_softc *sc)
        struct mfi_cmd_tbolt *cmd_tbolt;
        uint16_t smid;
        uint8_t reply_descript_type;
-       struct mfi_mpi2_request_raid_scsi_io  *scsi_io_req;
        uint32_t status, extStatus;
        uint16_t num_completed;
        union desc_value val;
@@ -700,7 +699,6 @@ mfi_tbolt_complete_cmd(struct mfi_softc *sc)
                        goto next;
                }
                cmd_mfi = &sc->mfi_commands[cmd_tbolt->sync_cmd_idx];
-               scsi_io_req = cmd_tbolt->io_request;
 
                status = cmd_mfi->cm_frame->dcmd.header.cmd_status;
                extStatus = cmd_mfi->cm_frame->dcmd.header.scsi_status;
@@ -939,7 +937,7 @@ static int
 mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
                   pMpi25IeeeSgeChain64_t sgl_ptr, struct mfi_cmd_tbolt *cmd)
 {
-       uint8_t i, sg_processed, sg_to_process;
+       uint8_t i, sg_processed;
        uint8_t sge_count, sge_idx;
        union mfi_sgl *os_sgl;
        pMpi25IeeeSgeChain64_t sgl_end;
@@ -997,7 +995,7 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command 
*mfi_cmd,
 
        if (sg_processed < sge_count) {
                pMpi25IeeeSgeChain64_t sg_chain;
-               sg_to_process = sge_count - sg_processed;
+
                cmd->io_request->ChainOffset =
                    sc->chain_offset_value_for_main_message;
                sg_chain = sgl_ptr;
@@ -1086,12 +1084,10 @@ int
 mfi_tbolt_send_frame(struct mfi_softc *sc, struct mfi_command *cm)
 {
        struct mfi_frame_header *hdr;
-       uint8_t *cdb;
        union mfi_mpi2_request_descriptor *req_desc = NULL;
        int tm = mfi_polled_cmd_timeout * 1000;
 
        hdr = &cm->cm_frame->header;
-       cdb = cm->cm_frame->pass.cdb;
        if (sc->adpreset)
                return 1;
        if ((cm->cm_flags & MFI_CMD_POLLED) == 0) {

Reply via email to