From: Mihaela Muraru <mihaela.muraru21@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [Outreachy kernel] [PATCH] staging: vc04_services: Remove typedef struct
Date: Thu, 28 Sep 2017 04:24:59 -0700 [thread overview]
Message-ID: <20170928112459.GB11913@ubuntu> (raw)
In-Reply-To: <alpine.DEB.2.20.1709281308320.2865@hadrien>
On Thu, Sep 28, 2017 at 01:12:02PM +0200, Julia Lawall wrote:
>
>
> On Thu, 28 Sep 2017, Mihaela Muraru wrote:
>
> > This patch removes typedef from struct and renames it from "typdedef struc vchiq_2835_state_struct" to "struct vchiq_2835_state" as per kernel coding standards.
>
> The log message should fit within at most 70-some characters per line.
>
> Otherwise, this code seems to have a lot of cleanup potential. Besides
> all the typedefs, you can also try to get rid of the pervasive casts and
> to use more kernel-standard return values. It looks like the inited field
> could have type bool and true/false values too. These would all be other
> patches of course.
>
> julia
>
Thank you for your help
I will work on it :)
Mihaela
> > Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
> > ---
> > .../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 16 ++++++++--------
> > 1 file changed, 8 insertions(+), 8 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 12b0e0d..ee00f51 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
> > @@ -59,10 +59,10 @@
> > #define BELL0 0x00
> > #define BELL2 0x08
> >
> > -typedef struct vchiq_2835_state_struct {
> > +struct vchiq_2835_state {
> > int inited;
> > VCHIQ_ARM_STATE_T arm_state;
> > -} VCHIQ_2835_ARM_STATE_T;
> > +};
> >
> > struct vchiq_pagelist_info {
> > PAGELIST_T *pagelist;
> > @@ -206,12 +206,12 @@ vchiq_platform_init_state(VCHIQ_STATE_T *state)
> > {
> > VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
> >
> > - state->platform_state = kzalloc(sizeof(VCHIQ_2835_ARM_STATE_T), GFP_KERNEL);
> > - ((VCHIQ_2835_ARM_STATE_T *)state->platform_state)->inited = 1;
> > - status = vchiq_arm_init_state(state, &((VCHIQ_2835_ARM_STATE_T *)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)
> > {
> > - ((VCHIQ_2835_ARM_STATE_T *)state->platform_state)->inited = 0;
> > + ((struct vchiq_2835_state *)state->platform_state)->inited = 0;
> > }
> > return status;
> > }
> > @@ -219,11 +219,11 @@ vchiq_platform_init_state(VCHIQ_STATE_T *state)
> > VCHIQ_ARM_STATE_T*
> > vchiq_platform_get_arm_state(VCHIQ_STATE_T *state)
> > {
> > - if (!((VCHIQ_2835_ARM_STATE_T *)state->platform_state)->inited)
> > + if (!((struct vchiq_2835_state *)state->platform_state)->inited)
> > {
> > BUG();
> > }
> > - return &((VCHIQ_2835_ARM_STATE_T *)state->platform_state)->arm_state;
> > + return &((struct vchiq_2835_state *)state->platform_state)->arm_state;
> > }
> >
> > void
> > --
> > 2.7.4
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170928110230.GA11755%40ubuntu.
> > For more options, visit https://groups.google.com/d/optout.
> >
next prev parent reply other threads:[~2017-09-28 11:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 11:02 [PATCH] staging: vc04_services: Remove typedef struct Mihaela Muraru
2017-09-28 11:12 ` [Outreachy kernel] " Julia Lawall
2017-09-28 11:24 ` Mihaela Muraru [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-09-21 19:09 Harsha Sharma
2017-09-21 20:55 ` [Outreachy kernel] " Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170928112459.GB11913@ubuntu \
--to=mihaela.muraru21@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=stefan.wahren@i2se.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.