On Fri, Sep 30, 2016 at 10:48:25PM +0300, Jarkko Sakkinen wrote:
> On Fri, Sep 30, 2016 at 12:30:26PM -0600, Jason Gunthorpe wrote:
> > On Fri, Sep 30, 2016 at 09:27:03PM +0300, Jarkko Sakkinen wrote:
> > > On Wed, Sep 28, 2016 at 04:34:36AM -0400, Nayna Jain wrote:
> > 
> > > > -       struct dentry **bios_dir;
> > > > +       struct dentry *bios_dir[3];
> > > > +       unsigned int bios_dir_count;
> > > 
> > > You should rather have a four entry array and use a NULL terminator.
> > 
> > Why? Then everything has to compute the length before doing
> > anything. The basic ops are 'append to back' and 'pop off back' which
> > require length.
> 
> One variable less to struct tpm_chip. The loop that removes the files
> simply can continue until NULL is encountered.

We've been over this, the loop has to remove them in reverse over.

Why are you so concerned about size of tpm_chip??

> Where do you need the length?

Every place that touches the array

Jason

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to