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 7907e4c268d87c75e4fe87b82ba93a752a0ad917..b0a2a4526a7c972cf08a5cadcf2d576951d153b8 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;