Subject: [PATCH 4/9] iommu/arm-smmu: Check for num_context_irqs > 0 to avoid divide by zero exception

From: [email-masked] (Andreas Herrmann)
Date: Fri, 27 Sep 2013 13:07:56 +0200

On Fri, Sep 27, 2013 at 06:48:02AM -0400, Will Deacon wrote:
> On Fri, Sep 27, 2013 at 11:39:49AM +0100, Andreas Herrmann wrote:
> > On Fri, Sep 27, 2013 at 06:23:07AM -0400, Will Deacon wrote:
> > > What do you think?
> > 
> > Yes, that should suffice.
> > 
> > I know it's clear for us but what about a short comment to emphasize
> > that we expect to find at least one context irq?
> > 
> > -       if (num_irqs < smmu->num_global_irqs) {
> > +       /* expect num_global_irqs plus at least one context irq */
> > +       if (num_irqs <= smmu->num_global_irqs) {
> > 
> > which can be translated to
> > 
> > -       if (num_irqs < smmu->num_global_irqs) {
> > +       if (!smmu->num_context_irqs) {
> 
> Even better! Do you want to send a patch, or shall I just create one myself?

I can do it.
(Have to update other patches anyway.)

Andreas