From nobody Sat Dec 04 07:09:08 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D199018C5AEE; Sat, 4 Dec 2021 07:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J5gm44Cnwz4lhM; Sat, 4 Dec 2021 07:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7194B1FD73; Sat, 4 Dec 2021 07:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B4798QS078942; Sat, 4 Dec 2021 07:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B4798RD078941; Sat, 4 Dec 2021 07:09:08 GMT (envelope-from git) Date: Sat, 4 Dec 2021 07:09:08 GMT Message-Id: <202112040709.1B4798RD078941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Scott Long Subject: git: 98470f0e0bc7 - main - Fix "set but not used" in mrsas. This includes removing unnecessary cdevsw methods. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: scottl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98470f0e0bc72d5e6a9aaeff42ed72f92972365d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638601748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGRdnmjqn9M+PUbMQPwBJv8EUXXxCX+DnJw2nL0F1OI=; b=nIOQyHOiNE2YkdcYK8aSY3gJZWlzMYmCuPC1K3qfQyp0mO9+qnVy6aYT6q2KnpfeEiNUUc 0IygZ30AcXT6R2g8NJVZwfNhuy9+1eQ2x8482HToMMgwhEP8/dFFqHJfyMieAZXse4IYx7 i/aqpYDJ453L+DKjzFNsrxAEgsBfgKIcsqUjtBfTU2xoxrNkLIfBzWZbXMPwFYO47Y7brZ viA5V0jQfXV6R/MFtghaoUxvI6tAGjSs3xscrCaviuXf0WV/86jFdrpdVIxOjlerB3ulPc pVMukLayDvAI354RU0zVGcmnXvJb28GYcRZ/3h8z/b+WFE83CWCGNNMnBa0iNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638601748; a=rsa-sha256; cv=none; b=Jg+CwFZK4dKkZuJ/XlcXLM3JSpw9diK3Fy4h0DcenDRiUG0xlAOhDkF4KjgmR6Tm2pxTRZ TYkz0yU/sKyMVf9rP2SIh7HV8Xk2QdQm2Rj7eMeMmBpgDFL4ghui8mKYOr+52kzEsl6gKX DSykpL4Qbg1kYZaRvNjF6+2JYdL+RsZf+t+XviyJw0sI2jpnuxAgh85AZ18pSYUCNtfyfk RJcm1tGIcJcm0efbx08B8W3NnJx0uXLEH23b923WOn9bhz6xSpYI9A6pn1bjQwifKSNKot xHlj4whScmgKM6xt4wDIq23tKlmxq2OZgidmG4GgBPTURSa43mXDWp9gtkWKlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by scottl: URL: https://cgit.FreeBSD.org/src/commit/?id=98470f0e0bc72d5e6a9aaeff42ed72f92972365d commit 98470f0e0bc72d5e6a9aaeff42ed72f92972365d Author: Scott Long AuthorDate: 2021-12-04 07:08:27 +0000 Commit: Scott Long CommitDate: 2021-12-04 07:08:27 +0000 Fix "set but not used" in mrsas. This includes removing unnecessary cdevsw methods. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/mrsas/mrsas.c | 43 +++++-------------------------------------- sys/dev/mrsas/mrsas_cam.c | 6 ------ 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index 8814642fccd0..c032959fcc86 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -59,8 +59,6 @@ __FBSDID("$FreeBSD$"); */ static d_open_t mrsas_open; static d_close_t mrsas_close; -static d_read_t mrsas_read; -static d_write_t mrsas_write; static d_ioctl_t mrsas_ioctl; static d_poll_t mrsas_poll; @@ -225,8 +223,6 @@ static struct cdevsw mrsas_cdevsw = { .d_version = D_VERSION, .d_open = mrsas_open, .d_close = mrsas_close, - .d_read = mrsas_read, - .d_write = mrsas_write, .d_ioctl = mrsas_ioctl, .d_poll = mrsas_poll, .d_name = "mrsas", @@ -234,43 +230,17 @@ static struct cdevsw mrsas_cdevsw = { MALLOC_DEFINE(M_MRSAS, "mrsasbuf", "Buffers for the MRSAS driver"); -/* - * In the cdevsw routines, we find our softc by using the si_drv1 member of - * struct cdev. We set this variable to point to our softc in our attach - * routine when we create the /dev entry. - */ int mrsas_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - struct mrsas_softc *sc; - sc = dev->si_drv1; return (0); } int mrsas_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { - struct mrsas_softc *sc; - sc = dev->si_drv1; - return (0); -} - -int -mrsas_read(struct cdev *dev, struct uio *uio, int ioflag) -{ - struct mrsas_softc *sc; - - sc = dev->si_drv1; - return (0); -} -int -mrsas_write(struct cdev *dev, struct uio *uio, int ioflag) -{ - struct mrsas_softc *sc; - - sc = dev->si_drv1; return (0); } @@ -321,26 +291,24 @@ void mrsas_disable_intr(struct mrsas_softc *sc) { u_int32_t mask = 0xFFFFFFFF; - u_int32_t status; sc->mask_interrupts = 1; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), mask); /* Dummy read to force pci flush */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); + (void)mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); } void mrsas_enable_intr(struct mrsas_softc *sc) { u_int32_t mask = MFI_FUSION_ENABLE_INTERRUPT_MASK; - u_int32_t status; sc->mask_interrupts = 0; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), ~0); - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + (void)mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), ~mask); - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); + (void)mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); } static int @@ -2975,7 +2943,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int ocr) int i; u_int8_t max_wait; u_int32_t val, fw_state; - u_int32_t cur_state; + u_int32_t cur_state __unused; u_int32_t abs_state, curr_abs_state; val = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); @@ -4407,7 +4375,7 @@ mrsas_sync_map_info(struct mrsas_softc *sc) int retcode = 0, i; struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; - uint32_t size_sync_info, num_lds; + uint32_t num_lds; MR_LD_TARGET_SYNC *target_map = NULL; MR_DRV_RAID_MAP_ALL *map; MR_LD_RAID *raid; @@ -4423,7 +4391,6 @@ mrsas_sync_map_info(struct mrsas_softc *sc) num_lds = map->raidMap.ldCount; dcmd = &cmd->frame->dcmd; - size_sync_info = sizeof(MR_LD_TARGET_SYNC) * num_lds; memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); target_map = (MR_LD_TARGET_SYNC *) sc->raidmap_mem[(sc->map_id - 1) & 1]; diff --git a/sys/dev/mrsas/mrsas_cam.c b/sys/dev/mrsas/mrsas_cam.c index 85dacdb9f306..2fc5049c7a0f 100644 --- a/sys/dev/mrsas/mrsas_cam.c +++ b/sys/dev/mrsas/mrsas_cam.c @@ -1188,7 +1188,6 @@ mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, u_int32_t device_id, ld; MR_DRV_RAID_MAP_ALL *map_ptr; MR_LD_RAID *raid; - RAID_CONTEXT *pRAID_Context; MRSAS_RAID_SCSI_IO_REQUEST *io_request; io_request = cmd->io_request; @@ -1197,8 +1196,6 @@ mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; ld = MR_TargetIdToLdGet(device_id, map_ptr); raid = MR_LdRaidGet(ld, map_ptr); - /* get RAID_Context pointer */ - pRAID_Context = &io_request->RaidContext.raid_context; /* Store the TM capability value in cmd */ cmd->tmCapable = raid->capability.tmCapable; @@ -1248,12 +1245,9 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, u_int32_t device_id; MR_DRV_RAID_MAP_ALL *local_map_ptr; MRSAS_RAID_SCSI_IO_REQUEST *io_request; - RAID_CONTEXT *pRAID_Context; struct MR_PD_CFG_SEQ_NUM_SYNC *pd_sync; io_request = cmd->io_request; - /* get RAID_Context pointer */ - pRAID_Context = &io_request->RaidContext.raid_context; device_id = ccb_h->target_id; local_map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; io_request->RaidContext.raid_context.RAIDFlags = MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD