staging/rdma/hfi1: Use pointer instead of struct name
authorJubin John <jubin.john@intel.com>
Mon, 15 Feb 2016 04:21:16 +0000 (20:21 -0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 11 Mar 2016 01:45:40 +0000 (20:45 -0500)
Use sizeof(*p) instead of sizeof(struct foo) to fix checkpatch check:
CHECK: Prefer alloc(sizeof(*p)...) over alloc(sizeof(struct foo)...)

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/pio.c

index 7907e4c..b0a2a45 100644 (file)
@@ -700,7 +700,7 @@ struct send_context *sc_alloc(struct hfi1_devdata *dd, int type,
        if (dd->flags & HFI1_FROZEN)
                return NULL;
 
-       sc = kzalloc_node(sizeof(struct send_context), GFP_KERNEL, numa);
+       sc = kzalloc_node(sizeof(*sc), GFP_KERNEL, numa);
        if (!sc)
                return NULL;