* [PATCH] iommu/vt-d: constify intel_dma_ops.
@ 2017-06-13 10:18 Arvind Yadav
[not found] ` <b1e3c53042ae405bf5bf86b0c06a4ee4f74c3fc3.1497349024.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Arvind Yadav @ 2017-06-13 10:18 UTC (permalink / raw)
To: dwmw2, joro; +Cc: iommu, linux-kernel
File size before:
text data bss dec hex filename
32765 758 1824 35347 8a13 drivers/iommu/intel-iommu.o
File size After adding 'const':
text data bss dec hex filename
32925 598 1824 35347 8a13 drivers/iommu/intel-iommu.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/iommu/intel-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 90ab011..de0df48 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3970,7 +3970,7 @@ static int intel_mapping_error(struct device *dev, dma_addr_t dma_addr)
return !dma_addr;
}
-struct dma_map_ops intel_dma_ops = {
+const struct dma_map_ops intel_dma_ops = {
.alloc = intel_alloc_coherent,
.free = intel_free_coherent,
.map_sg = intel_map_sg,
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/vt-d: constify intel_dma_ops.
[not found] ` <b1e3c53042ae405bf5bf86b0c06a4ee4f74c3fc3.1497349024.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-06-28 8:53 ` Joerg Roedel
[not found] ` <20170628085318.GB14532-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Joerg Roedel @ 2017-06-28 8:53 UTC (permalink / raw)
To: Arvind Yadav
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Tue, Jun 13, 2017 at 03:48:34PM +0530, Arvind Yadav wrote:
> File size before:
> text data bss dec hex filename
> 32765 758 1824 35347 8a13 drivers/iommu/intel-iommu.o
>
> File size After adding 'const':
> text data bss dec hex filename
> 32925 598 1824 35347 8a13 drivers/iommu/intel-iommu.o
What is the point of those commit-messages? They just show that the
struct moved from data to the text segment. The overall size doesn't
change much.
Joerg
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/vt-d: constify intel_dma_ops.
[not found] ` <20170628085318.GB14532-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2017-06-28 10:01 ` Arvind Yadav
[not found] ` <0868ed89-f9f2-1983-ea63-2e391142b44b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Arvind Yadav @ 2017-06-28 10:01 UTC (permalink / raw)
To: Joerg Roedel
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, linux-kernel-u79uwXL29TY76Z2rM5mHXA
Hi,
Most dma_map_ops structures are never modified. Constify these
structures such that these can be write-protected. This file size diff
will show the difference between data and text segment.
Thanks,
~arvind
On Wednesday 28 June 2017 02:23 PM, Joerg Roedel wrote:
> On Tue, Jun 13, 2017 at 03:48:34PM +0530, Arvind Yadav wrote:
>> File size before:
>> text data bss dec hex filename
>> 32765 758 1824 35347 8a13 drivers/iommu/intel-iommu.o
>>
>> File size After adding 'const':
>> text data bss dec hex filename
>> 32925 598 1824 35347 8a13 drivers/iommu/intel-iommu.o
> What is the point of those commit-messages? They just show that the
> struct moved from data to the text segment. The overall size doesn't
> change much.
>
>
>
> Joerg
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/vt-d: constify intel_dma_ops.
[not found] ` <0868ed89-f9f2-1983-ea63-2e391142b44b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-06-28 10:20 ` Joerg Roedel
0 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2017-06-28 10:20 UTC (permalink / raw)
To: Arvind Yadav
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Wed, Jun 28, 2017 at 03:31:16PM +0530, Arvind Yadav wrote:
> Most dma_map_ops structures are never modified. Constify these
> structures such that these can be write-protected. This file size diff
> will show the difference between data and text segment.
I know what the diff shows, but it doesn't matter for this patch because
thats just an implementation detail of the compiler. The real reason for
making it 'const' is to write-protect them, and that should be clear in
the commit-message.
Joerg
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-28 10:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 10:18 [PATCH] iommu/vt-d: constify intel_dma_ops Arvind Yadav
[not found] ` <b1e3c53042ae405bf5bf86b0c06a4ee4f74c3fc3.1497349024.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-28 8:53 ` Joerg Roedel
[not found] ` <20170628085318.GB14532-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-06-28 10:01 ` Arvind Yadav
[not found] ` <0868ed89-f9f2-1983-ea63-2e391142b44b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-28 10:20 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).