lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YcI8ChRmECkk/6RV@debianG>
Date:   Tue, 21 Dec 2021 17:41:46 -0300
From:   Gaston Gonzalez <gascoar@...il.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     linux-staging@...ts.linux.dev, nsaenz@...nel.org,
        f.fainelli@...il.com, rjui@...adcom.com, sbranden@...adcom.com,
        bcm-kernel-feedback-list@...adcom.com,
        juerg.haefliger@...onical.com, rdunlap@...radead.org,
        dave.stevenson@...pberrypi.com, stefan.wahren@...e.com,
        unixbhaskar@...il.com, mitaliborkar810@...il.com,
        phil@...pberrypi.com, linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        gascoar@...il.com
Subject: Re: [PATCH 2/4] staging: vc04_services: avoid the use of typedef for
 function pointers

On Tue, Dec 21, 2021 at 07:19:45AM +0100, Greg KH wrote:
> On Mon, Dec 20, 2021 at 06:29:12PM -0300, Gaston Gonzalez wrote:
> > Replace typedef bm2835_mmal_v4l2_ctrl_cb with equivalent declaration to
> > better align with the linux kernel coding style.
> > 
> > Signed-off-by: Gaston Gonzalez <gascoar@...il.com>
> > ---
> >  .../vc04_services/bcm2835-camera/controls.c   | 76 +++++++++----------
> >  1 file changed, 35 insertions(+), 41 deletions(-)
> > 
> > diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c
> > index b096a12387f7..7782742396fc 100644
> > --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
> > +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
> > @@ -65,13 +65,6 @@ enum bm2835_mmal_ctrl_type {
> >  	MMAL_CONTROL_TYPE_CLUSTER, /* special cluster entry */
> >  };
> >  
> > -struct bm2835_mmal_v4l2_ctrl;
> > -
> > -typedef	int(bm2835_mmal_v4l2_ctrl_cb)(
> > -				struct bm2835_mmal_dev *dev,
> > -				struct v4l2_ctrl *ctrl,
> > -				const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl);
> 
> Function pointer typedefs are ok, if they are needed.
> 
> > -
> >  struct bm2835_mmal_v4l2_ctrl {
> >  	u32 id; /* v4l2 control identifier */
> >  	enum bm2835_mmal_ctrl_type type;
> > @@ -84,7 +77,8 @@ struct bm2835_mmal_v4l2_ctrl {
> >  	u64 step; /* step size of the control */
> >  	const s64 *imenu; /* integer menu array */
> >  	u32 mmal_id; /* mmal parameter id */
> > -	bm2835_mmal_v4l2_ctrl_cb *setter;
> > +	int (*bm2835_mmal_v4l2_ctrl_cb)(struct bm2835_mmal_dev *dev, struct v4l2_ctrl *ctrl,
> > +					const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl);
> 
> No need to rename this function pointer, why not keep it at "setter"?
> That would make this patch much smaller and more obvious.
> 

Ok, will do that in v2.

thanks,

Gaston


> thanks,
> 
> greg k-h
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ