]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/hns: Simplify doorbell initialization code
authorLang Cheng <chenglang@huawei.com>
Tue, 5 Nov 2019 11:07:59 +0000 (19:07 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 8 Nov 2019 20:37:54 +0000 (16:37 -0400)
If a variable needs to be set to 0 before use, it can be directly
initialized to 0.

Link: https://lore.kernel.org/r/1572952082-6681-7-git-send-email-liweihang@hisilicon.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c

index 4700bac1c6e22902c3a4c84a5e4893961c4135dc..a8ce3716a63e30b51c20dc40e145a389fa6b63f5 100644 (file)
@@ -4944,10 +4944,7 @@ static void hns_roce_v2_init_irq_work(struct hns_roce_dev *hr_dev,
 static void set_eq_cons_index_v2(struct hns_roce_eq *eq)
 {
        struct hns_roce_dev *hr_dev = eq->hr_dev;
-       __le32 doorbell[2];
-
-       doorbell[0] = 0;
-       doorbell[1] = 0;
+       __le32 doorbell[2] = {};
 
        if (eq->type_flag == HNS_ROCE_AEQ) {
                roce_set_field(doorbell[0], HNS_ROCE_V2_EQ_DB_CMD_M,