Correct sizeof usage
Obtained from: DragonFly
This commit is contained in:
parent
365e076ed2
commit
c61325d009
@ -1078,7 +1078,7 @@ mfi_tbolt_build_mpt_cmd(struct mfi_softc *sc, struct mfi_command *cmd)
|
||||
if (!req_desc)
|
||||
return NULL;
|
||||
|
||||
bzero(req_desc, sizeof(req_desc));
|
||||
bzero(req_desc, sizeof(*req_desc));
|
||||
req_desc->header.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO <<
|
||||
MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
|
||||
req_desc->header.SMID = index;
|
||||
|
@ -2214,7 +2214,7 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm)
|
||||
sense_len = min(returned_sense_len,
|
||||
ccb->csio.sense_len - ccb->csio.sense_resid);
|
||||
bzero(&ccb->csio.sense_data,
|
||||
sizeof(&ccb->csio.sense_data));
|
||||
sizeof(ccb->csio.sense_data));
|
||||
bcopy(cm->cm_sense, &ccb->csio.sense_data, sense_len);
|
||||
ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
|
||||
}
|
||||
|
@ -3187,7 +3187,7 @@ mpt_scsi_reply_frame_handler(struct mpt_softc *mpt, request_t *req,
|
||||
else
|
||||
ccb->csio.sense_resid = 0;
|
||||
|
||||
bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data));
|
||||
bzero(&ccb->csio.sense_data, sizeof(ccb->csio.sense_data));
|
||||
bcopy(req->sense_vbuf, &ccb->csio.sense_data,
|
||||
min(ccb->csio.sense_len, sense_returned));
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ firmware_register(const char *imagename, const void *data, size_t datasize,
|
||||
free(str, M_TEMP);
|
||||
return NULL;
|
||||
}
|
||||
bzero(frp, sizeof(frp)); /* start from a clean record */
|
||||
bzero(frp, sizeof(*frp)); /* start from a clean record */
|
||||
frp->fw.name = str;
|
||||
frp->fw.data = data;
|
||||
frp->fw.datasize = datasize;
|
||||
|
@ -125,7 +125,7 @@ int main(int argc, char *argv[])
|
||||
int len;
|
||||
int raw;
|
||||
|
||||
memset(&s_in, 0, sizeof(&s_in));
|
||||
memset(&s_in, 0, sizeof(s_in));
|
||||
s_in.sin_family = PF_INET;
|
||||
s_in.sin_port = htons(666);
|
||||
s_in.sin_addr.s_addr = INADDR_ANY;
|
||||
|
@ -332,7 +332,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
sip = argv[1];
|
||||
|
||||
memset(&s_in, 0, sizeof(&s_in));
|
||||
memset(&s_in, 0, sizeof(s_in));
|
||||
us = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (s == -1) {
|
||||
perror("socket()");
|
||||
|
Loading…
Reference in New Issue
Block a user