mps(4): Remove some useless casts.
authorSascha Wildner <saw@online.de>
Tue, 7 Feb 2012 10:53:42 +0000 (11:53 +0100)
committerSascha Wildner <saw@online.de>
Fri, 10 Feb 2012 10:33:51 +0000 (11:33 +0100)
I've inserted them by mistake because I had not realized that the
wrong typedefs for U32 and S32 were the real issue.

sys/dev/raid/mps/mps.c
sys/dev/raid/mps/mps_config.c
sys/dev/raid/mps/mps_sas.c
sys/dev/raid/mps/mps_sas_lsi.c
sys/dev/raid/mps/mps_table.c
sys/dev/raid/mps/mps_user.c

index 4861c39..0ef3353 100644 (file)
@@ -584,7 +584,7 @@ mps_get_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts, int port)
        if ((reply->IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) {
                mps_printf(sc,
                    "%s error %d iocstatus 0x%x iocloginfo 0x%x type 0x%x\n",
-                   __func__, error, reply->IOCStatus, (u_int)reply->IOCLogInfo,
+                   __func__, error, reply->IOCStatus, reply->IOCLogInfo,
                    reply->PortType);
                error = ENXIO;
        }
@@ -1059,7 +1059,7 @@ mps_attach(struct mps_softc *sc)
 
        mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version,
            MPS_DRIVER_VERSION);
-       mps_printf(sc, "IOCCapabilities: %b\n", (int)sc->facts->IOCCapabilities,
+       mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities,
            "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf"
            "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR"
            "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc");
@@ -1863,7 +1863,7 @@ mps_push_sge(struct mps_command *cm, void *sgep, size_t len, int segsleft)
                if (((sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT) &
                    MPI2_SGE_FLAGS_ADDRESS_SIZE) == 0)
                        panic("SGE simple %p flags %02x not marked 64-bit?",
-                           sge, (u_int)(sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT));
+                           sge, sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT);
 
                break;
        default:
index 44b70eb..e24eb0f 100644 (file)
@@ -295,7 +295,7 @@ mps_config_get_man_pg10(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply)
        /*
         * Set the phys disks hide/expose value.
         */
-       pPS_info = (uint32_t *)&page->ProductSpecificInfo;
+       pPS_info = &page->ProductSpecificInfo;
        sc->WD_hide_expose = (uint8_t)(pPS_info[5]);
        sc->WD_hide_expose &= MPS_WD_HIDE_EXPOSE_MASK;
        if ((sc->WD_hide_expose != MPS_WD_HIDE_ALWAYS) &&
index 58b6dc4..a5b78ea 100644 (file)
@@ -472,7 +472,7 @@ mpssas_remove_device(struct mps_softc *sc, struct mps_command *tm)
        }
 
        mps_dprint(sc, MPS_INFO, "Reset aborted %u commands\n",
-           (u_int)reply->TerminationCount);
+           reply->TerminationCount);
        mps_free_reply(sc, tm->cm_reply_data);
        tm->cm_reply = NULL;    /* Ensures the the reply won't get re-freed */
 
index 5664099..15112cf 100644 (file)
@@ -359,22 +359,22 @@ mpssas_fw_work(struct mps_softc *sc, struct mps_fw_event_work *fw_event)
                case MPI2_EVENT_IR_VOLUME_RC_SETTINGS_CHANGED:
                        mps_dprint(sc, MPS_INFO, "   Volume Settings "
                            "changed from 0x%x to 0x%x for Volome with "
-                           "handle 0x%x", (u_int)event_data->PreviousValue,
-                           (u_int)event_data->NewValue,
+                           "handle 0x%x", event_data->PreviousValue,
+                           event_data->NewValue,
                            event_data->VolDevHandle);
                        break;
                case MPI2_EVENT_IR_VOLUME_RC_STATUS_FLAGS_CHANGED:
                        mps_dprint(sc, MPS_INFO, "   Volume Status "
                            "changed from 0x%x to 0x%x for Volome with "
-                           "handle 0x%x", (u_int)event_data->PreviousValue,
-                           (u_int)event_data->NewValue,
+                           "handle 0x%x", event_data->PreviousValue,
+                           event_data->NewValue,
                            event_data->VolDevHandle);
                        break;
                case MPI2_EVENT_IR_VOLUME_RC_STATE_CHANGED:
                        mps_dprint(sc, MPS_INFO, "   Volume State "
                            "changed from 0x%x to 0x%x for Volome with "
-                           "handle 0x%x", (u_int)event_data->PreviousValue,
-                           (u_int)event_data->NewValue,
+                           "handle 0x%x", event_data->PreviousValue,
+                           event_data->NewValue,
                            event_data->VolDevHandle);
                        break;
                default:
@@ -396,8 +396,8 @@ mpssas_fw_work(struct mps_softc *sc, struct mps_fw_event_work *fw_event)
                        mps_dprint(sc, MPS_INFO, "   Phys Disk Settings "
                            "changed from 0x%x to 0x%x for Phys Disk Number "
                            "%d and handle 0x%x at Enclosure handle 0x%x, Slot "
-                           "%d", (u_int)event_data->PreviousValue,
-                           (u_int)event_data->NewValue, event_data->PhysDiskNum,
+                           "%d", event_data->PreviousValue,
+                           event_data->NewValue, event_data->PhysDiskNum,
                            event_data->PhysDiskDevHandle,
                            event_data->EnclosureHandle, event_data->Slot);
                        break;
@@ -405,7 +405,7 @@ mpssas_fw_work(struct mps_softc *sc, struct mps_fw_event_work *fw_event)
                        mps_dprint(sc, MPS_INFO, "   Phys Disk Status changed "
                            "from 0x%x to 0x%x for Phys Disk Number %d and "
                            "handle 0x%x at Enclosure handle 0x%x, Slot %d",
-                           (u_int)event_data->PreviousValue, (u_int)event_data->NewValue,
+                           event_data->PreviousValue, event_data->NewValue,
                            event_data->PhysDiskNum,
                            event_data->PhysDiskDevHandle,
                            event_data->EnclosureHandle, event_data->Slot);
@@ -414,7 +414,7 @@ mpssas_fw_work(struct mps_softc *sc, struct mps_fw_event_work *fw_event)
                        mps_dprint(sc, MPS_INFO, "   Phys Disk State changed "
                            "from 0x%x to 0x%x for Phys Disk Number %d and "
                            "handle 0x%x at Enclosure handle 0x%x, Slot %d",
-                           (u_int)event_data->PreviousValue, (u_int)event_data->NewValue,
+                           event_data->PreviousValue, event_data->NewValue,
                            event_data->PhysDiskNum,
                            event_data->PhysDiskDevHandle,
                            event_data->EnclosureHandle, event_data->Slot);
index c2344d7..0d18940 100644 (file)
@@ -210,7 +210,7 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
        MPS_PRINTFIELD(sc, facts, RequestCredit, %d);
        MPS_PRINTFIELD(sc, facts, ProductID, 0x%x);
        mps_dprint_field(sc, MPS_INFO, "IOCCapabilities: %b\n",
-           (u_int)facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace"
+           facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace"
            "\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast"
            "\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel"
            "\20MSIXIndex" "\21HostDisc");
@@ -253,8 +253,7 @@ mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
        MPS_EVENTFIELD(sc, event, AckRequired, %d);
        mps_dprint_field(sc, MPS_EVENT, "Event: %s (0x%x)\n",
            mps_describe_table(mps_event_names, event->Event), event->Event);
-       mps_dprint_field(sc, MPS_EVENT, "EventContext: 0x%x\n",
-           (u_int)event->EventContext);
+       MPS_EVENTFIELD(sc, event, EventContext, 0x%x);
 }
 
 void
@@ -271,7 +270,7 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
        MPS_PRINTFIELD(sc, buf, DevHandle, 0x%x);
        MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x);
        MPS_PRINTFIELD(sc, buf, ZoneGroup, %d);
-       mps_dprint_field(sc, MPS_INFO, "DeviceInfo: %b,%s\n", (int)buf->DeviceInfo,
+       mps_dprint_field(sc, MPS_INFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
            "\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit"
            "\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct"
            "\15LsiDev" "\16AtapiDev" "\17SepDev",
@@ -304,7 +303,7 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
                    mps_describe_table(mps_sasdisc_reason, data->ReasonCode));
                MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
                mps_dprint_field(sc, MPS_EVENT, "DiscoveryStatus: %b\n",
-                   (int)data->DiscoveryStatus,  "\20"
+                   data->DiscoveryStatus,  "\20"
                    "\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout"
                    "\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed"
                    "\11SmpCrcError" "\12SubSubLink" "\13TableTableLink"
@@ -359,8 +358,7 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
                MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
                MPS_EVENTFIELD(sc, data, NumSlots, %d);
                MPS_EVENTFIELD(sc, data, StartSlot, %d);
-               mps_dprint_field(sc, MPS_EVENT, "PhyBits: 0x%x\n",
-                   (u_int)data->PhyBits);
+               MPS_EVENTFIELD(sc, data, PhyBits, 0x%x);
                break;
        }
        case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
@@ -400,9 +398,9 @@ mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
        MPS_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
        mps_dprint_field(sc, MPS_INFO, "PhyInfo Reason: %s (0x%x)\n",
            mps_describe_table(mps_phyinfo_reason_names,
-           (buf->PhyInfo >> 16) & 0xf), (u_int)buf->PhyInfo);
+           (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
        mps_dprint_field(sc, MPS_INFO, "AttachedDeviceInfo: %b,%s\n",
-           (int)buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
+           buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
            "\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg"
            "\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev",
            mps_describe_table(mps_sasdev0_devtype,
@@ -415,11 +413,10 @@ mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
        MPS_PRINTFIELD(sc, buf, PhyIdentifier, %d);
        MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
        MPS_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x);
-       mps_dprint_field(sc, MPS_INFO, "AttachedPhyInfo: 0x%x\n",
-           (u_int)buf->AttachedPhyInfo);
+       MPS_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x);
        mps_dprint_field(sc, MPS_INFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
            mps_describe_table(mps_phyinfo_reason_names,
-           buf->AttachedPhyInfo & 0xf), (u_int)buf->AttachedPhyInfo);
+           buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
        MPS_PRINTFIELD(sc, buf, ZoneGroup, %d);
        MPS_PRINTFIELD(sc, buf, SelfConfigStatus, 0x%x);
 }
@@ -433,7 +430,7 @@ mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
        MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
        mps_dprint_field(sc, MPS_INFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
            mps_describe_table(mps_phyinfo_reason_names,
-           buf->AttachedPhyInfo & 0xf), (u_int)buf->AttachedPhyInfo);
+           buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
        mps_dprint_field(sc, MPS_INFO, "ProgrammedLinkRate: %s (0x%x)\n",
            mps_describe_table(mps_linkrate_names,
            (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
@@ -444,7 +441,7 @@ mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
        MPS_PRINTFIELD(sc, buf, Flags, 0x%x);
        mps_dprint_field(sc, MPS_INFO, "PhyInfo Reason: %s (0x%x)\n",
            mps_describe_table(mps_phyinfo_reason_names,
-           (buf->PhyInfo >> 16) & 0xf), (u_int)buf->PhyInfo);
+           (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
        mps_dprint_field(sc, MPS_INFO, "NegotiatedLinkRate: %s (0x%x)\n",
            mps_describe_table(mps_linkrate_names,
            buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
@@ -468,7 +465,7 @@ mps_print_sgl(struct mps_softc *sc, struct mps_command *cm, int offset)
        while (frame != NULL) {
                flags = sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT;
                kprintf("seg%d flags=0x%x len=0x%x addr=0x%jx\n", i, flags,
-                   (u_int)(sge->FlagsLength & 0xffffff), mps_to_u64(&sge->Address));
+                   sge->FlagsLength & 0xffffff, mps_to_u64(&sge->Address));
                if (flags & (MPI2_SGE_FLAGS_END_OF_LIST |
                    MPI2_SGE_FLAGS_END_OF_BUFFER))
                        break;
@@ -478,7 +475,7 @@ mps_print_sgl(struct mps_softc *sc, struct mps_command *cm, int offset)
                        sgc = (MPI2_SGE_CHAIN32 *)sge;
                        kprintf("chain flags=0x%x len=0x%x Offset=0x%x "
                            "Address=0x%x\n", sgc->Flags, sgc->Length,
-                           sgc->NextChainOffset, (u_int)sgc->Address);
+                           sgc->NextChainOffset, sgc->Address);
                        if (chain == NULL)
                                chain = TAILQ_FIRST(&cm->cm_chain_list);
                        else
index 76ba6d9..7eb3a92 100644 (file)
@@ -1205,7 +1205,7 @@ mps_post_fw_diag_buffer(struct mps_softc *sc,
                mps_dprint(sc, MPS_FAULT, "%s: post of FW  Diag Buffer failed "
                    "with IOCStatus = 0x%x, IOCLogInfo = 0x%x and "
                    "TransferLength = 0x%x\n", __func__, reply->IOCStatus,
-                   (u_int)reply->IOCLogInfo, (u_int)reply->TransferLength);
+                   reply->IOCLogInfo, reply->TransferLength);
                goto done;
        }
 
@@ -1289,7 +1289,7 @@ mps_release_fw_diag_buffer(struct mps_softc *sc,
                status = MPS_DIAG_FAILURE;
                mps_dprint(sc, MPS_FAULT, "%s: release of FW Diag Buffer "
                    "failed with IOCStatus = 0x%x and IOCLogInfo = 0x%x\n",
-                   __func__, reply->IOCStatus, (u_int)reply->IOCLogInfo);
+                   __func__, reply->IOCStatus, reply->IOCLogInfo);
                goto done;
        }