Correct sizeof usage

Obtained from:	DragonFly
This commit is contained in:
Kevin Lo 2012-06-25 05:41:16 +00:00
parent 365e076ed2
commit c61325d009
6 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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));
}

View File

@ -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;

View File

@ -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;

View File

@ -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()");