public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [git pull] AMD-IOMMU (AMD-Vi) updates for 2.6.32
Date: Fri, 4 Sep 2009 16:15:39 +0200	[thread overview]
Message-ID: <20090904141539.GD4906@amd.com> (raw)
In-Reply-To: <20090904141113.GA21026@elte.hu>

On Fri, Sep 04, 2009 at 04:11:13PM +0200, Ingo Molnar wrote:
> 
> * Joerg Roedel <joerg.roedel@amd.com> wrote:
> 
> > Hi Ingo,
> > 
> > thanks for your comments.
> > 
> > On Fri, Sep 04, 2009 at 03:06:45PM +0200, Ingo Molnar wrote:
> > > +static void dump_dte_entry(u16 devid)
> > > +{
> > > +       int i;
> > > +
> > > +       for (i = 0; i < 8; ++i)
> > > +               pr_err("AMD-Vi: DTE[%d]: %08x\n", i,
> > > +                       amd_iommu_dev_table[devid].data[i]);
> > > 
> > > that 8 is not very obvious - it deserves a comment. (we allocate at 
> > > least one page to amd_iommu_dev_table[] so it's safe - but where the 
> > > 8 comes from is not very clear.)
> > 
> > Right. I will add a comment.
> > 
> > > Also, we tend to write 'i++' not '++i' in loops. (there's other 
> > > examples of this too in the iommu files)
> > 
> > Ok, I use ++i for historic reasons from my old c++ times ;-) Is there a
> > specific reason i++ is prefered?
> > 
> > > This log printing pattern:
> > > 
> > >         printk(KERN_ERR "AMD-Vi: Event logged [");
> > > 
> > >         switch (type) {
> > >         case EVENT_TYPE_ILL_DEV:
> > >                 printk("ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x "
> > >                        "address=0x%016llx flags=0x%04x]\n",
> > > 
> > > is now broken (produces an unexpected newline) due to:
> > > 
> > >   5fd29d6: printk: clean up handling of log-levels and newlines
> > > 
> > > you probably want to convert all printk's to pr_*() calls, and use 
> > > pr_cont() in the above place.
> > 
> > Ok, I will chance this too.
> > 
> > > Similar comments hold for dump_command() as well.
> > > 
> > > +++ b/arch/x86/include/asm/amd_iommu_types.h
> > > @@ -457,4 +457,7 @@ static inline void amd_iommu_stats_init(void) { 
> > > }
> > >  
> > >  #endif /* CONFIG_AMD_IOMMU_STATS */
> > >  
> > > +/* some function prototypes */
> > > +extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);
> > > +
> > > 
> > > function prototypes belong into amd_iommu.h, not amd_iommu_types.h.
> > 
> > The plan is to do it the other way around. Currently amd_iommu.h 
> > contains the driver exported function prototypes and the 
> > prototypes of functions only shared between amd_iommu_init.c and 
> > amd_iommu.c. So my plan is to move the prototypes of the functions 
> > only shared between the two driver source files to 
> > amd_iommu_types.h. The prototypes I put into source files should 
> > all be forward declarations of static functions only. Should these 
> > be in header files too?
> 
> Well, generally we only put data type definitions and constants into 
> *_types.h files. If you need multiple include files for methods i'd 
> suggest to split amd_iomm.h into two or so.

Ok, right, its better to split amd_iommu.h here then.

	Joerg



      reply	other threads:[~2009-09-04 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 10:05 [git pull] AMD-IOMMU (AMD-Vi) updates for 2.6.32 Joerg Roedel
2009-09-04 13:06 ` Ingo Molnar
2009-09-04 13:56   ` Joerg Roedel
2009-09-04 14:11     ` Ingo Molnar
2009-09-04 14:15       ` Joerg Roedel [this message]

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=20090904141539.GD4906@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox