Re: [PATCH 8/8]: Initialisation assignments of 0 are redundant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/9/07, Gerrit Renker <gerrit@xxxxxxxxxxxxxx> wrote:
> [CCID3]: 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@xxxxxxxxxxxxxx>

Signed-off-by: Ian McDonald <ian.mcdonald@xxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe dccp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux