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


Groups > linux.kernel > #1475556

Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h

From Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h
Date 2016-09-03 08:30 +0200
Message-ID <sdcCJ-1GY-1@gated-at.bofh.it> (permalink)
References <sd4vv-4PZ-11@gated-at.bofh.it> <sd4Yx-5fv-1@gated-at.bofh.it> <sd5hT-5pg-3@gated-at.bofh.it> <sd5rA-5sw-5@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


On Fri, Sep 02, 2016 at 04:45:31PM -0600, Jason Gunthorpe wrote:
> On Sat, Sep 03, 2016 at 01:35:22AM +0300, Jarkko Sakkinen wrote:
> > On Fri, Sep 02, 2016 at 04:11:22PM -0600, Jason Gunthorpe wrote:
> > > On Sat, Sep 03, 2016 at 12:48:03AM +0300, Jarkko Sakkinen wrote:
> > > > The struct tpm_class_ops is not used outside the TPM driver. Thus,
> > > > it can be safely move to drivers/char/tpm/tpm.h.
> > > 
> > > No, this is the wrong direction.
> > > 
> > > The goal is to make things more like other subsystems, so we should be
> > > moving struct tpm_chip into the public header, and that requires ops
> > > to be in the public header.
> > > 
> > > This is why I put ops here in the first place.
> > 
> > I'm OK with it as long as you explain why this is necessary. I see no
> > use for them outside the TPM subsystem.
> 
> That is because the users out side the subsystem are Doing it Wrong.
> 
> eg this:
> 
>  extern int tpm_is_tpm2(u32 chip_num);
> 
> Should be:
> 
>  extern int tpm_is_tpm2(struct tpm_chip *chip);
> 
> And same for all other examples.
> 
> The 'chip_num' thing is bonkers.

OK, how would one get the chip instance?

/Jarkko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-02 23:50 +0200
  Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-09-03 00:20 +0200
    Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-03 00:40 +0200
      Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-09-03 00:50 +0200
        Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-03 08:30 +0200
          Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-03 08:30 +0200
            Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-09-04 22:20 +0200
              Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-05 07:50 +0200
                Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-09-05 19:50 +0200

csiph-web