summaryrefslogtreecommitdiffstats
path: root/sys/dev/mrsas
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2014-10-21 07:31:21 +0000
committerhselasky <hselasky@FreeBSD.org>2014-10-21 07:31:21 +0000
commit49c137f7be5791eee8102395257cdf48b40c81f7 (patch)
treeee67959a46304c59df434799575e3820a2cc841f /sys/dev/mrsas
parentfef9d98869a5c15698b0511d8ff1044b517f1e8f (diff)
downloadFreeBSD-src-49c137f7be5791eee8102395257cdf48b40c81f7.zip
FreeBSD-src-49c137f7be5791eee8102395257cdf48b40c81f7.tar.gz
Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/dev/mrsas')
-rw-r--r--sys/dev/mrsas/mrsas.c2
-rw-r--r--sys/dev/mrsas/mrsas.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c
index 24738eb..9c1caa0 100644
--- a/sys/dev/mrsas/mrsas.c
+++ b/sys/dev/mrsas/mrsas.c
@@ -412,7 +412,7 @@ mrsas_setup_sysctl(struct mrsas_softc *sc)
SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree),
OID_AUTO, "fw_outstanding", CTLFLAG_RD,
- &sc->fw_outstanding, 0, "FW outstanding commands");
+ &sc->fw_outstanding.val_rdonly, 0, "FW outstanding commands");
SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree),
OID_AUTO, "io_cmds_highwater", CTLFLAG_RD,
diff --git a/sys/dev/mrsas/mrsas.h b/sys/dev/mrsas/mrsas.h
index 16dc95d..37b6e95 100644
--- a/sys/dev/mrsas/mrsas.h
+++ b/sys/dev/mrsas/mrsas.h
@@ -511,8 +511,9 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UNION {
} MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION,
Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t;
-typedef struct {
+typedef union {
volatile unsigned int val;
+ unsigned int val_rdonly;
} mrsas_atomic_t;
#define mrsas_atomic_read(v) atomic_load_acq_int(&(v)->val)
@@ -2523,7 +2524,7 @@ struct mrsas_softc {
void *ctlr_info_mem;
bus_addr_t ctlr_info_phys_addr;
u_int32_t max_sectors_per_req;
- u_int8_t disableOnlineCtrlReset;
+ u_int32_t disableOnlineCtrlReset;
mrsas_atomic_t fw_outstanding;
u_int32_t mrsas_debug;
u_int32_t mrsas_io_timeout;
OpenPOWER on IntegriCloud