Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2012 05:41:16 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237546 - in head: sys/dev/mfi sys/dev/mps sys/dev/mpt sys/kern tools/tools/net80211/w00t/redir tools/tools/net80211/wesside/dics
Message-ID:  <201206250541.q5P5fGIv052885@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Mon Jun 25 05:41:16 2012
New Revision: 237546
URL: http://svn.freebsd.org/changeset/base/237546

Log:
  Correct sizeof usage
  
  Obtained from:	DragonFly

Modified:
  head/sys/dev/mfi/mfi_tbolt.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mpt/mpt_cam.c
  head/sys/kern/subr_firmware.c
  head/tools/tools/net80211/w00t/redir/buddy.c
  head/tools/tools/net80211/wesside/dics/dics.c

Modified: head/sys/dev/mfi/mfi_tbolt.c
==============================================================================
--- head/sys/dev/mfi/mfi_tbolt.c	Mon Jun 25 04:26:10 2012	(r237545)
+++ head/sys/dev/mfi/mfi_tbolt.c	Mon Jun 25 05:41:16 2012	(r237546)
@@ -1078,7 +1078,7 @@ mfi_tbolt_build_mpt_cmd(struct mfi_softc
 	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;

Modified: head/sys/dev/mps/mps_sas.c
==============================================================================
--- head/sys/dev/mps/mps_sas.c	Mon Jun 25 04:26:10 2012	(r237545)
+++ head/sys/dev/mps/mps_sas.c	Mon Jun 25 05:41:16 2012	(r237546)
@@ -2214,7 +2214,7 @@ mpssas_scsiio_complete(struct mps_softc 
 			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;
 		}

Modified: head/sys/dev/mpt/mpt_cam.c
==============================================================================
--- head/sys/dev/mpt/mpt_cam.c	Mon Jun 25 04:26:10 2012	(r237545)
+++ head/sys/dev/mpt/mpt_cam.c	Mon Jun 25 05:41:16 2012	(r237546)
@@ -3187,7 +3187,7 @@ mpt_scsi_reply_frame_handler(struct mpt_
 		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));
 	}

Modified: head/sys/kern/subr_firmware.c
==============================================================================
--- head/sys/kern/subr_firmware.c	Mon Jun 25 04:26:10 2012	(r237545)
+++ head/sys/kern/subr_firmware.c	Mon Jun 25 05:41:16 2012	(r237546)
@@ -198,7 +198,7 @@ firmware_register(const char *imagename,
 		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;

Modified: head/tools/tools/net80211/w00t/redir/buddy.c
==============================================================================
--- head/tools/tools/net80211/w00t/redir/buddy.c	Mon Jun 25 04:26:10 2012	(r237545)
+++ head/tools/tools/net80211/w00t/redir/buddy.c	Mon Jun 25 05:41:16 2012	(r237546)
@@ -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;

Modified: head/tools/tools/net80211/wesside/dics/dics.c
==============================================================================
--- head/tools/tools/net80211/wesside/dics/dics.c	Mon Jun 25 04:26:10 2012	(r237545)
+++ head/tools/tools/net80211/wesside/dics/dics.c	Mon Jun 25 05:41:16 2012	(r237546)
@@ -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()");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206250541.q5P5fGIv052885>