• Gerrit Renker's avatar
    [CCID2/3]: Initialisation assignments of 0 are redundant · 24c667db
    Gerrit Renker authored
    Assigning initial values of `0' is redundant when loading a new CCID structure,
    since in net/dccp/ccid.c the entire CCID structure is zeroed out prior to
    initialisation in ccid_new():
    
        	struct ccid {
        		struct ccid_operations *ccid_ops;
        		char		       ccid_priv[0];
        	};
    
        	// ...
        	if (rx) {
        		memset(ccid + 1, 0, ccid_ops->ccid_hc_rx_obj_size);
        		if (ccid->ccid_ops->ccid_hc_rx_init != NULL &&
        		    ccid->ccid_ops->ccid_hc_rx_init(ccid, sk) != 0)
        			goto out_free_ccid;
        	} else {
        		memset(ccid + 1, 0, ccid_ops->ccid_hc_tx_obj_size);
        		/* analogous to the rx case */
        	}
    
    This patch therefore removes the redundant assignments. Thanks to Arnaldo for
    the inspiration.
    Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
    Signed-off-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    24c667db
ccid2.c 21.3 KB