diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-05-22 08:11:01 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2017-06-22 18:07:04 -0400 |
commit | ae72c9910b170e55386586cf18ef9015a8d172e6 (patch) | |
tree | daa936737d8a2133f47f4bfd5dc9741ad0f6c580 /net/nfc | |
parent | e1038535106e73e48204ec3bfe5a428fe6cb35cb (diff) |
NFC: digital: Improve a size determination in four functions
Replace the specification of four data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/digital_core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c index ebeace7a8278..321514636da1 100644 --- a/net/nfc/digital_core.c +++ b/net/nfc/digital_core.c | |||
@@ -240,7 +240,7 @@ int digital_send_cmd(struct nfc_digital_dev *ddev, u8 cmd_type, | |||
240 | { | 240 | { |
241 | struct digital_cmd *cmd; | 241 | struct digital_cmd *cmd; |
242 | 242 | ||
243 | cmd = kzalloc(sizeof(struct digital_cmd), GFP_KERNEL); | 243 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); |
244 | if (!cmd) | 244 | if (!cmd) |
245 | return -ENOMEM; | 245 | return -ENOMEM; |
246 | 246 | ||
@@ -287,7 +287,7 @@ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech) | |||
287 | { | 287 | { |
288 | struct digital_tg_mdaa_params *params; | 288 | struct digital_tg_mdaa_params *params; |
289 | 289 | ||
290 | params = kzalloc(sizeof(struct digital_tg_mdaa_params), GFP_KERNEL); | 290 | params = kzalloc(sizeof(*params), GFP_KERNEL); |
291 | if (!params) | 291 | if (!params) |
292 | return -ENOMEM; | 292 | return -ENOMEM; |
293 | 293 | ||
@@ -706,7 +706,7 @@ static int digital_in_send(struct nfc_dev *nfc_dev, struct nfc_target *target, | |||
706 | struct digital_data_exch *data_exch; | 706 | struct digital_data_exch *data_exch; |
707 | int rc; | 707 | int rc; |
708 | 708 | ||
709 | data_exch = kzalloc(sizeof(struct digital_data_exch), GFP_KERNEL); | 709 | data_exch = kzalloc(sizeof(*data_exch), GFP_KERNEL); |
710 | if (!data_exch) { | 710 | if (!data_exch) { |
711 | pr_err("Failed to allocate data_exch struct\n"); | 711 | pr_err("Failed to allocate data_exch struct\n"); |
712 | return -ENOMEM; | 712 | return -ENOMEM; |
@@ -764,7 +764,7 @@ struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops, | |||
764 | !ops->switch_rf || (ops->tg_listen_md && !ops->tg_get_rf_tech)) | 764 | !ops->switch_rf || (ops->tg_listen_md && !ops->tg_get_rf_tech)) |
765 | return NULL; | 765 | return NULL; |
766 | 766 | ||
767 | ddev = kzalloc(sizeof(struct nfc_digital_dev), GFP_KERNEL); | 767 | ddev = kzalloc(sizeof(*ddev), GFP_KERNEL); |
768 | if (!ddev) | 768 | if (!ddev) |
769 | return NULL; | 769 | return NULL; |
770 | 770 | ||