i2c: brcmstb: allocate correct amount of memory for regmap
Kamal Dasu
Reviewed-byQuoted 2 lines
We want the size of the struct, not of a pointer to it. To be future proof, just dereference the pointer to get the desired type.
Thanks for catching and fixing this.
Quoted 2 lines
Signed-off-by Wolfram Sang <[email protected]>
Kamal
PATCH 1/1 i2c: brcmstb: allocate correct amount of memory for regmap
Wolfram,
I found a minor checkpatch issue with the change while applying the patch to my local branch.
WARNING: line over 80 characters
#11: FILE: drivers/i2c/busses/i2c-brcmstb.c:589:
+ dev->bsc_regmap = devm_kzalloc(&pdev->dev,sizeof(*dev->bsc_regmap), GFP_KERNEL);
Kamal
Quoted 11 lines · Kamal Dasu
Quoted 2 lines
We want the size of the struct, not of a pointer to it. To be future proof, just dereference the pointer to get the desired type.
Thanks for catching and fixing this.
Quoted 2 lines
Signed-off-by Wolfram Sang <[email protected]>Reviewed-by Kamal Dasu <[email protected]>Kamal
PATCH 1/1 i2c: brcmstb: allocate correct amount of memory for regmap
Quoted 1 line
WARNING: line over 80 characters
I am not too strict with this one. If one is just slightly over 80 chars and then breaks the line, readability of the code usually gets worse.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160301/df673fc2/attachment.sig>