8395 mr_sas: sizeof on array function parameter will return size of pointer
Review Request #584 — Created June 15, 2017 and submitted
Information | |
---|---|
tsoome | |
illumos-gate | |
8395 | |
3b62b2f... | |
Reviewers | |
general | |
../../common/io/mr_sas/mr_sas_tbolt.c:3012:21: error: 'sizeof' on array function parameter 'cdb' will return size of 'uint8_t * {aka unsigned char *}' [-Werror=sizeof-array-argument] bzero(cdb, sizeof (cdb)); ^ ../../common/io/mr_sas/mr_sas_tbolt.c:2987:27: note: declared here mrsas_tbolt_set_pd_lba(U8 cdb[], uint8_t *cdb_len_ptr, U64 start_blk, ^~~ ../../common/io/mr_sas/mr_sas_tbolt.c:3045:21: error: 'sizeof' on array function parameter 'cdb' will return size of 'uint8_t * {aka unsigned char *}' [-Werror=sizeof-array-argument] bzero(cdb, sizeof (cdb)); ^ ../../common/io/mr_sas/mr_sas_tbolt.c:2987:27: note: declared here mrsas_tbolt_set_pd_lba(U8 cdb[], uint8_t *cdb_len_ptr, U64 start_blk, ^~~ ../../common/io/mr_sas/mr_sas_tbolt.c:3065:21: error: 'sizeof' on array function parameter 'cdb' will return size of 'uint8_t * {aka unsigned char *}' [-Werror=sizeof-array-argument] bzero(cdb, sizeof (cdb)); ^ ../../common/io/mr_sas/mr_sas_tbolt.c:2987:27: note: declared here mrsas_tbolt_set_pd_lba(U8 cdb[], uint8_t *cdb_len_ptr, U64 start_blk, ^~~ cc1: all warnings being treated as errors
-
-
usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c (Diff revision 1) So, here and in the other places, I think we want to semantically zero the entire buffer which is a 32-byte (or maybe larger) array. I think we should probably change this so the size of the actual cdb entry is passed in.
Alternatively we should use the length that was given to us that had the actual cdb length and zero all of that. This may be the better thing. Basically use cdb_len before we update it as that should represent the amount of data present.
Change Summary:
add cdb_size argument.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+9 -8) |
-
-
usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c (Diff revision 2) While touching this please add
num_blocks
here. -
usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c (Diff revision 2) Since you changed the prototype above to
U8 *
, please change it here too.
Change Summary:
updated function comment and argument type for cdb.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+10 -8) |