summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMihaela Muraru <mihaela.muraru21@gmail.com>2017-10-21 09:19:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-23 09:43:01 +0200
commitca3c5858834f75543a4e2e115b1578c01558b2ce (patch)
treee9ad99d5e8bf7bce8334a8c0a9bb91314ae94be2
parent7f6c756a04f9b3a780e613cbb4159ef00fa870ec (diff)
downloadlinux-ca3c5858834f75543a4e2e115b1578c01558b2ce.tar.gz
linux-ca3c5858834f75543a4e2e115b1578c01558b2ce.tar.bz2
linux-ca3c5858834f75543a4e2e115b1578c01558b2ce.zip
staging: vc04_services: Remove unnecessary braces
Remove unnecessary braces for single statements also declare a local variable "platform_state" of type "struct vchiq_2835_state", to avoid the multiple cast. Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 351fec8c2d44..eea2d78b0ec6 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -204,25 +204,31 @@ VCHIQ_STATUS_T
vchiq_platform_init_state(VCHIQ_STATE_T *state)
{
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
+ struct vchiq_2835_state *platform_state;
+
+ state->platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL);
+ platform_state = (struct vchiq_2835_state *)state->platform_state;
+
+ platform_state->inited = 1;
+ status = vchiq_arm_init_state(state, &platform_state->arm_state);
- state->platform_state = kzalloc(sizeof(struct vchiq_2835_state), GFP_KERNEL);
- ((struct vchiq_2835_state *)state->platform_state)->inited = 1;
- status = vchiq_arm_init_state(state, &((struct vchiq_2835_state *)state->platform_state)->arm_state);
if (status != VCHIQ_SUCCESS)
- {
- ((struct vchiq_2835_state *)state->platform_state)->inited = 0;
- }
+ platform_state->inited = 0;
+
return status;
}
VCHIQ_ARM_STATE_T*
vchiq_platform_get_arm_state(VCHIQ_STATE_T *state)
{
- if (!((struct vchiq_2835_state *)state->platform_state)->inited)
- {
+ struct vchiq_2835_state *platform_state;
+
+ platform_state = (struct vchiq_2835_state *)state->platform_state;
+
+ if (!platform_state->inited)
BUG();
- }
- return &((struct vchiq_2835_state *)state->platform_state)->arm_state;
+
+ return &platform_state->arm_state;
}
void