Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1717856 > unrolled thread

Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen

Started byDavid Miller <davem@davemloft.net>
First post2017-08-22 23:40 +0200
Last post2017-08-23 07:20 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen David Miller <davem@davemloft.net> - 2017-08-22 23:40 +0200
    RE: [PATCH v2 1/6] fsl/fman: enable FMan Keygen Madalin-cristian Bucur <madalin.bucur@nxp.com> - 2017-08-23 06:40 +0200
      Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen David Miller <davem@davemloft.net> - 2017-08-23 06:50 +0200
        RE: [PATCH v2 1/6] fsl/fman: enable FMan Keygen Madalin-cristian Bucur <madalin.bucur@nxp.com> - 2017-08-23 07:20 +0200

#1717856 — Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen

FromDavid Miller <davem@davemloft.net>
Date2017-08-22 23:40 +0200
SubjectRe: [PATCH v2 1/6] fsl/fman: enable FMan Keygen
Message-ID<uhp3X-86X-13@gated-at.bofh.it>
From: Madalin Bucur <madalin.bucur@nxp.com>
Date: Tue, 22 Aug 2017 20:31:01 +0300

>  /**
> + * fman_get_keygen
> + *
> + * @fman:	A Pointer to FMan device
> + *
> + * Get the handle to KeyGen module part of FM driver
> + *
> + * Return: Handle to KeyGen
> + */
> +struct fman_keygen *fman_get_keygen(struct fman *fman)
> +{
> +	return fman->keygen;
> +}
> +EXPORT_SYMBOL(fman_get_keygen);

Please don't do this.

Just directly derefence the pointer in the source code to
get the keygen.

Thank you.

[toc] | [next] | [standalone]


#1718026

FromMadalin-cristian Bucur <madalin.bucur@nxp.com>
Date2017-08-23 06:40 +0200
Message-ID<uhvCq-4iI-9@gated-at.bofh.it>
In reply to#1717856
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of David Miller
> Sent: Wednesday, August 23, 2017 12:35 AM
> Subject: Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen
> 
> From: Madalin Bucur <madalin.bucur@nxp.com>
> Date: Tue, 22 Aug 2017 20:31:01 +0300
> 
> >  /**
> > + * fman_get_keygen
> > + *
> > + * @fman:	A Pointer to FMan device
> > + *
> > + * Get the handle to KeyGen module part of FM driver
> > + *
> > + * Return: Handle to KeyGen
> > + */
> > +struct fman_keygen *fman_get_keygen(struct fman *fman)
> > +{
> > +	return fman->keygen;
> > +}
> > +EXPORT_SYMBOL(fman_get_keygen);
> 
> Please don't do this.
> 
> Just directly derefence the pointer in the source code to
> get the keygen.
> 
> Thank you.

Hi,

The struct fman is only visible in the fman file, the fman port module uses struct
fman as an opaque pointer, thus this export.

Madalin

[toc] | [prev] | [next] | [standalone]


#1718028

FromDavid Miller <davem@davemloft.net>
Date2017-08-23 06:50 +0200
Message-ID<uhvM5-4lW-1@gated-at.bofh.it>
In reply to#1718026
From: Madalin-cristian Bucur <madalin.bucur@nxp.com>
Date: Wed, 23 Aug 2017 04:36:56 +0000

> The struct fman is only visible in the fman file, the fman port
> module uses struct fman as an opaque pointer, thus this export.

Don't use that programming model.

Export the datastructure properly to it's users.

This abstraction scheme is so wasteful and costly.

[toc] | [prev] | [next] | [standalone]


#1718044

FromMadalin-cristian Bucur <madalin.bucur@nxp.com>
Date2017-08-23 07:20 +0200
Message-ID<uhwf7-4Nc-5@gated-at.bofh.it>
In reply to#1718028
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Wednesday, August 23, 2017 7:47 AM
> To: Madalin-cristian Bucur <madalin.bucur@nxp.com>
> Cc: netdev@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen
> 
> From: Madalin-cristian Bucur <madalin.bucur@nxp.com>
> Date: Wed, 23 Aug 2017 04:36:56 +0000
> 
> > The struct fman is only visible in the fman file, the fman port
> > module uses struct fman as an opaque pointer, thus this export.
> 
> Don't use that programming model.
> 
> Export the datastructure properly to it's users.
> 
> This abstraction scheme is so wasteful and costly.

Normally does not come with this cost, it's this case where one of the
sub-modules needs to call into another that gets things complicated.
I'll move struct fman to the header file.

Thanks,
Madalin

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web