if (IS_ERR(mailbox))
                return 0;
 
-       memset(mailbox->buf, 0, 256);
        memcpy(mailbox->buf, props->node_desc, 64);
        mlx4_cmd(to_mdev(ibdev)->dev, mailbox->dma, 1, 0,
                 MLX4_CMD_SET_NODE, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE);
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
 
-       memset(mailbox->buf, 0, 256);
-
        if (dev->dev->flags & MLX4_FLAG_OLD_PORT_CMDS) {
                *(u8 *) mailbox->buf         = !!reset_qkey_viols << 6;
                ((__be32 *) mailbox->buf)[2] = cpu_to_be32(cap_mask);
        struct mlx4_ib_dev *mdev = to_mdev(qp->device);
        struct mlx4_cmd_mailbox *mailbox;
        struct mlx4_net_trans_rule_hw_ctrl *ctrl;
-       size_t rule_size = sizeof(struct mlx4_net_trans_rule_hw_ctrl) +
-                          (sizeof(struct _rule_hw) * flow_attr->num_of_specs);
 
        static const u16 __mlx4_domain[] = {
                [IB_FLOW_DOMAIN_USER] = MLX4_DOMAIN_UVERBS,
        mailbox = mlx4_alloc_cmd_mailbox(mdev->dev);
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
-       memset(mailbox->buf, 0, rule_size);
        ctrl = mailbox->buf;
 
        ctrl->prio = cpu_to_be16(__mlx4_domain[domain] |
 
                return ERR_PTR(-ENOMEM);
        }
 
+       memset(mailbox->buf, 0, MLX4_MAILBOX_SIZE);
+
        return mailbox;
 }
 EXPORT_SYMBOL_GPL(mlx4_alloc_cmd_mailbox);
 
                return PTR_ERR(mailbox);
 
        cq_context = mailbox->buf;
-       memset(cq_context, 0, sizeof *cq_context);
-
        cq_context->cq_max_count = cpu_to_be16(count);
        cq_context->cq_period    = cpu_to_be16(period);
 
                return PTR_ERR(mailbox);
 
        cq_context = mailbox->buf;
-       memset(cq_context, 0, sizeof *cq_context);
-
        cq_context->logsize_usrpage = cpu_to_be32(ilog2(entries) << 24);
        cq_context->log_page_size   = mtt->page_shift - 12;
        mtt_addr = mlx4_mtt_addr(dev, mtt);
        }
 
        cq_context = mailbox->buf;
-       memset(cq_context, 0, sizeof *cq_context);
-
        cq_context->flags           = cpu_to_be32(!!collapsed << 18);
        if (timestamp_en)
                cq_context->flags  |= cpu_to_be32(1 << 19);
 
                return PTR_ERR(mailbox);
 
        filter = mailbox->buf;
-       memset(filter, 0, sizeof(*filter));
        for (i = VLAN_FLTR_SIZE - 1; i >= 0; i--) {
                entry = 0;
                for (j = 0; j < 32; j++)
        mailbox = mlx4_alloc_cmd_mailbox(mdev->dev);
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
-       memset(mailbox->buf, 0, sizeof(*qport_context));
        err = mlx4_cmd_box(mdev->dev, 0, mailbox->dma, port, 0,
                           MLX4_CMD_QUERY_PORT, MLX4_CMD_TIME_CLASS_B,
                           MLX4_CMD_WRAPPED);
        mailbox = mlx4_alloc_cmd_mailbox(mdev->dev);
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
-       memset(mailbox->buf, 0, sizeof(*mlx4_en_stats));
        err = mlx4_cmd_box(mdev->dev, 0, mailbox->dma, in_mod, 0,
                           MLX4_CMD_DUMP_ETH_STATS, MLX4_CMD_TIME_CLASS_B,
                           MLX4_CMD_WRAPPED);
 
        if (err)
                goto err_out_free_mtt;
 
-       memset(eq_context, 0, sizeof *eq_context);
        eq_context->flags         = cpu_to_be32(MLX4_EQ_STATUS_OK   |
                                                MLX4_EQ_STATE_ARMED);
        eq_context->log_eq_size   = ilog2(eq->nent);
 
                return PTR_ERR(mailbox);
        inbox = mailbox->buf;
 
-       memset(inbox, 0, MOD_STAT_CFG_IN_SIZE);
-
        MLX4_PUT(inbox, cfg->log_pg_sz, MOD_STAT_CFG_PG_SZ_OFFSET);
        MLX4_PUT(inbox, cfg->log_pg_sz_m, MOD_STAT_CFG_PG_SZ_M_OFFSET);
 
        mailbox = mlx4_alloc_cmd_mailbox(dev);
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
-       memset(mailbox->buf, 0, MLX4_MAILBOX_SIZE);
        pages = mailbox->buf;
 
        for (mlx4_icm_first(icm, &iter);
                return PTR_ERR(mailbox);
        inbox = mailbox->buf;
 
-       memset(inbox, 0, INIT_HCA_IN_SIZE);
-
        *((u8 *) mailbox->buf + INIT_HCA_VERSION_OFFSET) = INIT_HCA_VERSION;
 
        *((u8 *) mailbox->buf + INIT_HCA_CACHELINE_SZ_OFFSET) =
                        return PTR_ERR(mailbox);
                inbox = mailbox->buf;
 
-               memset(inbox, 0, INIT_PORT_IN_SIZE);
-
                flags = 0;
                flags |= (dev->caps.vl_cap[port] & 0xf) << INIT_PORT_VL_SHIFT;
                flags |= (dev->caps.port_width_cap[port] & 0xf) << INIT_PORT_PORT_WIDTH_SHIFT;
 
                goto out_list;
        }
        mgm = mailbox->buf;
-       memset(mgm, 0, sizeof *mgm);
        members_count = 0;
        list_for_each_entry(dqp, &s_steer->promisc_qps[steer], list)
                mgm->qp[members_count++] = cpu_to_be32(dqp->qpn & MGM_QPN_MASK);
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
 
-       memset(mailbox->buf, 0, sizeof(struct mlx4_net_trans_rule_hw_ctrl));
        trans_rule_ctrl_to_hw(rule, mailbox->buf);
 
        size += sizeof(struct mlx4_net_trans_rule_hw_ctrl);
 
                goto err_table;
        }
        mpt_entry = mailbox->buf;
-
-       memset(mpt_entry, 0, sizeof *mpt_entry);
-
        mpt_entry->flags = cpu_to_be32(MLX4_MPT_FLAG_MIO         |
                                       MLX4_MPT_FLAG_REGION      |
                                       mr->access);
        }
        mpt_entry = mailbox->buf;
 
-       memset(mpt_entry, 0, sizeof(*mpt_entry));
-
        /* Note that the MLX4_MPT_FLAG_REGION bit in mpt_entry->flags is turned
         * off, thus creating a memory window and not a memory region.
         */
 
 
        inbuf = inmailbox->buf;
        outbuf = outmailbox->buf;
-       memset(inbuf, 0, 256);
-       memset(outbuf, 0, 256);
        inbuf[0] = 1;
        inbuf[1] = 1;
        inbuf[2] = 1;
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
 
-       memset(mailbox->buf, 0, 256);
-
        ((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port];
 
        if (pkey_tbl_sz >= 0 && mlx4_is_master(dev)) {
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
-
        context->flags = SET_PORT_GEN_ALL_VALID;
        context->mtu = cpu_to_be16(mtu);
        context->pptx = (pptx * (!pfctx)) << 7;
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
-
        context->base_qpn = cpu_to_be32(base_qpn);
        context->n_mac = dev->caps.log_num_macs;
        context->promisc = cpu_to_be32(promisc << SET_PORT_PROMISC_SHIFT |
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
-
        for (i = 0; i < MLX4_NUM_UP; i += 2)
                context->prio2tc[i >> 1] = prio2tc[i] << 4 | prio2tc[i + 1];
 
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);
        context = mailbox->buf;
-       memset(context, 0, sizeof *context);
 
        for (i = 0; i < MLX4_NUM_TC; i++) {
                struct mlx4_port_scheduler_tc_cfg_be *tc = &context->tc[i];
 
        }
 
        srq_context = mailbox->buf;
-       memset(srq_context, 0, sizeof *srq_context);
-
        srq_context->state_logsize_srqn = cpu_to_be32((ilog2(srq->max) << 24) |
                                                      srq->srqn);
        srq_context->logstride          = srq->wqe_shift - 4;