All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ritesh Harjani <ritesh.harjani@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <Will.Deacon@arm.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Russell King <rmk@arm.linux.org.uk>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
Date: Wed, 4 Jun 2014 12:01:23 -0700	[thread overview]
Message-ID: <20140604190123.GC30884@kroah.com> (raw)
In-Reply-To: <CAD15agbiuXiiAp62R-NeLeX3rgNftmyb+wGiSVx-FgtcXzxpHA@mail.gmail.com>

On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
> >> --- a/include/linux/device.h
> >> +++ b/include/linux/device.h
> >> @@ -705,6 +705,10 @@ struct device {
> >>       /* arch specific additions */
> >>       struct dev_archdata     archdata;
> >>
> >> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
> >> +     struct dma_iommu_mapping        *mapping;
> >> +#endif
> >> +
> >>       struct device_node      *of_node; /* associated device tree node */
> >>       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
> >>
> >
> > Are you sure this will not break the build on systems that enable that
> > option, yet do not include iommu-helper.h?
> 
> They need to include iommu-helper.h wherever they are using this
> structure members. Until then no this should
> not break the build I think for the case you mentioned.

Try it and find out :)

> That's how it was done in arch/arm/include/asm/device.h

Perhaps something else was pulling in that .h file?  device.h is used
_everywhere_ you can not assume someone will have included another .h
file before it.

> Do I need to do this in diff way ?

Yes, just predefine the structure in the .h file.

And do you really need the #ifdef?

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: gregkh@linuxfoundation.org (Greg KH)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
Date: Wed, 4 Jun 2014 12:01:23 -0700	[thread overview]
Message-ID: <20140604190123.GC30884@kroah.com> (raw)
In-Reply-To: <CAD15agbiuXiiAp62R-NeLeX3rgNftmyb+wGiSVx-FgtcXzxpHA@mail.gmail.com>

On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
> >> --- a/include/linux/device.h
> >> +++ b/include/linux/device.h
> >> @@ -705,6 +705,10 @@ struct device {
> >>       /* arch specific additions */
> >>       struct dev_archdata     archdata;
> >>
> >> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
> >> +     struct dma_iommu_mapping        *mapping;
> >> +#endif
> >> +
> >>       struct device_node      *of_node; /* associated device tree node */
> >>       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
> >>
> >
> > Are you sure this will not break the build on systems that enable that
> > option, yet do not include iommu-helper.h?
> 
> They need to include iommu-helper.h wherever they are using this
> structure members. Until then no this should
> not break the build I think for the case you mentioned.

Try it and find out :)

> That's how it was done in arch/arm/include/asm/device.h

Perhaps something else was pulling in that .h file?  device.h is used
_everywhere_ you can not assume someone will have included another .h
file before it.

> Do I need to do this in diff way ?

Yes, just predefine the structure in the .h file.

And do you really need the #ifdef?

thanks,

greg k-h

  parent reply	other threads:[~2014-06-04 18:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04  8:11 [PATCH 0/1] device.h: Move out arch independent dma_iommu_mapping struct ritesh.harjani
2014-06-04  8:11 ` ritesh.harjani at gmail.com
2014-06-04  8:11 ` [PATCH 1/1] device.h: arm,dma-iommu: Move out " ritesh.harjani
2014-06-04  8:11   ` [PATCH 1/1] device.h: arm, dma-iommu: " ritesh.harjani at gmail.com
2014-06-04 17:51   ` [PATCH 1/1] device.h: arm,dma-iommu: " Greg KH
2014-06-04 17:51     ` Greg KH
2014-06-04 18:46     ` Ritesh Harjani
2014-06-04 18:46       ` [PATCH 1/1] device.h: arm, dma-iommu: " Ritesh Harjani
2014-06-04 18:59       ` [PATCH 1/1] device.h: arm,dma-iommu: " Greg KH
2014-06-04 18:59         ` Greg KH
2014-06-05  9:18         ` Ritesh Harjani
2014-06-05  9:18           ` [PATCH 1/1] device.h: arm, dma-iommu: " Ritesh Harjani
2014-06-04 19:01       ` Greg KH [this message]
2014-06-04 19:01         ` [PATCH 1/1] device.h: arm,dma-iommu: " Greg KH

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=20140604190123.GC30884@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Will.Deacon@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=ritesh.harjani@gmail.com \
    --cc=rmk@arm.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.