mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: re.emese@gmail.com
To: linux-kernel@vger.kernel.org
Cc: Emese Revfy <re.emese@gmail.com>,
	lethal@linux-sh.org, damm@opensource.se, matt@console-pimps.org,
	torvalds@linux-foundation.org
Subject: [PATCH 07/10] Constify struct dma_map_ops for 2.6.32-git-053fe57ac v2
Date: Mon, 14 Dec 2009 00:59:22 +0100	[thread overview]
Message-ID: <0b7ff7b7eed063c944688061ba51e7f510edd0e0.1260662996.git.re.emese@gmail.com> (raw)
In-Reply-To: <cover.1260662995.git.re.emese@gmail.com>

From: Emese Revfy <re.emese@gmail.com>


Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
 arch/sh/include/asm/dma-mapping.h |   14 +++++++-------
 arch/sh/kernel/dma-nommu.c        |    2 +-
 arch/sh/mm/consistent.c           |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index 87ced13..b28e1d9 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -1,10 +1,10 @@
 #ifndef __ASM_SH_DMA_MAPPING_H
 #define __ASM_SH_DMA_MAPPING_H
 
-extern struct dma_map_ops *dma_ops;
+extern const struct dma_map_ops *dma_ops;
 extern void no_iommu_init(void);
 
-static inline struct dma_map_ops *get_dma_ops(struct device *dev)
+static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
 {
 	return dma_ops;
 }
@@ -14,7 +14,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
 
 static inline int dma_supported(struct device *dev, u64 mask)
 {
-	struct dma_map_ops *ops = get_dma_ops(dev);
+	const struct dma_map_ops *ops = get_dma_ops(dev);
 
 	if (ops->dma_supported)
 		return ops->dma_supported(dev, mask);
@@ -24,7 +24,7 @@ static inline int dma_supported(struct device *dev, u64 mask)
 
 static inline int dma_set_mask(struct device *dev, u64 mask)
 {
-	struct dma_map_ops *ops = get_dma_ops(dev);
+	const struct dma_map_ops *ops = get_dma_ops(dev);
 
 	if (!dev->dma_mask || !dma_supported(dev, mask))
 		return -EIO;
@@ -59,7 +59,7 @@ static inline int dma_get_cache_alignment(void)
 
 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
-	struct dma_map_ops *ops = get_dma_ops(dev);
+	const struct dma_map_ops *ops = get_dma_ops(dev);
 
 	if (ops->mapping_error)
 		return ops->mapping_error(dev, dma_addr);
@@ -70,7 +70,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 static inline void *dma_alloc_coherent(struct device *dev, size_t size,
 				       dma_addr_t *dma_handle, gfp_t gfp)
 {
-	struct dma_map_ops *ops = get_dma_ops(dev);
+	const struct dma_map_ops *ops = get_dma_ops(dev);
 	void *memory;
 
 	if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
@@ -87,7 +87,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,
 static inline void dma_free_coherent(struct device *dev, size_t size,
 				     void *vaddr, dma_addr_t dma_handle)
 {
-	struct dma_map_ops *ops = get_dma_ops(dev);
+	const struct dma_map_ops *ops = get_dma_ops(dev);
 
 	WARN_ON(irqs_disabled());	/* for portability */
 
diff --git a/arch/sh/kernel/dma-nommu.c b/arch/sh/kernel/dma-nommu.c
index 3c55b87..92ccab3 100644
--- a/arch/sh/kernel/dma-nommu.c
+++ b/arch/sh/kernel/dma-nommu.c
@@ -62,7 +62,7 @@ static void nommu_sync_sg(struct device *dev, struct scatterlist *sg,
 }
 #endif
 
-struct dma_map_ops nommu_dma_ops = {
+const struct dma_map_ops nommu_dma_ops = {
 	.alloc_coherent		= dma_generic_alloc_coherent,
 	.free_coherent		= dma_generic_free_coherent,
 	.map_page		= nommu_map_page,
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index 902967e..904d1ce 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -21,7 +21,7 @@
 
 #define PREALLOC_DMA_DEBUG_ENTRIES	4096
 
-struct dma_map_ops *dma_ops;
+const struct dma_map_ops *dma_ops;
 EXPORT_SYMBOL(dma_ops);
 
 static int __init dma_init(void)
-- 
1.6.5.3


  parent reply	other threads:[~2009-12-14  0:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 23:59 [PATCH 00/10] " re.emese
2009-12-13 23:59 ` [PATCH 01/10] " re.emese
2009-12-13 23:59 ` [PATCH 02/10] " re.emese
2009-12-13 23:59 ` [PATCH 03/10] " re.emese
2009-12-13 23:59 ` [PATCH 04/10] " re.emese
2009-12-13 23:59 ` [PATCH 1/3] Constify struct block_device_operations " re.emese
2009-12-13 23:59 ` [PATCH 05/10] Constify struct dma_map_ops " re.emese
2009-12-13 23:59 ` [PATCH 06/10] " re.emese
2009-12-13 23:59 ` [PATCH 2/3] Constify struct block_device_operations " re.emese
2009-12-13 23:59 ` re.emese [this message]
2009-12-13 23:59 ` [PATCH 3/3] " re.emese
2009-12-13 23:59 ` [PATCH 08/10] Constify struct dma_map_ops " re.emese
2009-12-13 23:59 ` [PATCH 09/10] " re.emese
2009-12-13 23:59 ` [PATCH 10/10] " re.emese
2009-12-14 10:10 ` [PATCH 0/3] Constify struct block_device_operations " Joerg Roedel
2009-12-14 22:55   ` Emese Revfy

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=0b7ff7b7eed063c944688061ba51e7f510edd0e0.1260662996.git.re.emese@gmail.com \
    --to=re.emese@gmail.com \
    --cc=damm@opensource.se \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®