Date: Tue, 23 Oct 2012 15:16:50 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241937 - in stable/9/sys/cam: ata scsi Message-ID: <201210231516.q9NFGoub094392@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Oct 23 15:16:50 2012 New Revision: 241937 URL: http://svn.freebsd.org/changeset/base/241937 Log: MFC r241404: Remove 'periph == NULL' check from bunch of periph drivers. This condition can never be true as functions are called from single place and the checks just pollute the code and confuse Clang Static Analyzer. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_pmp.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_ch.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pass.c stable/9/sys/cam/scsi/scsi_sa.c stable/9/sys/cam/scsi/scsi_sg.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/ata/ata_da.c Tue Oct 23 15:16:50 2012 (r241937) @@ -943,11 +943,6 @@ adaregister(struct cam_periph *periph, v int legacy_id, quirks; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("adaregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("adaregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/ata/ata_pmp.c Tue Oct 23 15:16:50 2012 (r241937) @@ -367,11 +367,6 @@ pmpregister(struct cam_periph *periph, v struct ccb_getdev *cgd; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("pmpregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("pmpregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/ata/ata_xpt.c Tue Oct 23 15:16:50 2012 (r241937) @@ -224,11 +224,6 @@ proberegister(struct cam_periph *periph, probe_softc *softc; request_ccb = (union ccb *)arg; - if (periph == NULL) { - printf("proberegister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (request_ccb == NULL) { printf("proberegister: no probe CCB, " "can't register device\n"); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_cd.c Tue Oct 23 15:16:50 2012 (r241937) @@ -641,10 +641,6 @@ cdregister(struct cam_periph *periph, vo caddr_t match; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("cdregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } if (cgd == NULL) { printf("cdregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ch.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_ch.c Tue Oct 23 15:16:50 2012 (r241937) @@ -324,11 +324,6 @@ chregister(struct cam_periph *periph, vo struct ccb_pathinq cpi; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("chregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("chregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Oct 23 15:16:50 2012 (r241937) @@ -1550,11 +1550,6 @@ daregister(struct cam_periph *periph, vo caddr_t match; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("daregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("daregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_pass.c Tue Oct 23 15:16:50 2012 (r241937) @@ -312,11 +312,6 @@ passregister(struct cam_periph *periph, int no_tags; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("%s: periph was NULL!!\n", __func__); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("%s: no getdev CCB, can't register device\n", __func__); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_sa.c Tue Oct 23 15:16:50 2012 (r241937) @@ -1445,11 +1445,6 @@ saregister(struct cam_periph *periph, vo int i; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("saregister: periph was NULL!!\n"); - return (CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("saregister: no getdev CCB, can't register device\n"); return (CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sg.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_sg.c Tue Oct 23 15:16:50 2012 (r241937) @@ -261,11 +261,6 @@ sgregister(struct cam_periph *periph, vo int no_tags; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("sgregister: periph was NULL!!\n"); - return (CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("sgregister: no getdev CCB, can't register device\n"); return (CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_xpt.c Tue Oct 23 15:16:50 2012 (r241937) @@ -615,11 +615,6 @@ proberegister(struct cam_periph *periph, probe_softc *softc; request_ccb = (union ccb *)arg; - if (periph == NULL) { - printf("proberegister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (request_ccb == NULL) { printf("proberegister: no probe CCB, " "can't register device\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210231516.q9NFGoub094392>