Repository navigation
Commit 24c667d
[CCID2/3]: Initialisation assignments of 0 are redundant
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: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>1 parent 76fd1e8 commit 24c667d
2 files changed
Lines changed: 0 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | | - | |
754 | 753 | | |
755 | 754 | | |
756 | 755 | | |
757 | 756 | | |
758 | 757 | | |
759 | | - | |
760 | 758 | | |
761 | 759 | | |
762 | 760 | | |
763 | | - | |
764 | 761 | | |
765 | 762 | | |
766 | | - | |
767 | 763 | | |
768 | 764 | | |
769 | 765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
608 | | - | |
609 | 607 | | |
610 | 608 | | |
611 | 609 | | |
| |||
966 | 964 | | |
967 | 965 | | |
968 | 966 | | |
969 | | - | |
970 | | - | |
971 | 967 | | |
972 | 968 | | |
973 | 969 | | |
| |||
0 commit comments