linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: macb: constify macb configuration data
@ 2015-03-09 16:14 Josh Cartwright
  2015-03-09 19:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Josh Cartwright @ 2015-03-09 16:14 UTC (permalink / raw)
  To: Nicolas Ferre, David S. Miller; +Cc: netdev, linux-kernel

The configurations are not modified by the driver.  Make them 'const' so
that they may be placed in a read-only section.

Signed-off-by: Josh Cartwright <joshc@ni.com>
---
 drivers/net/ethernet/cadence/macb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 1fe8b94..2c30572 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -2131,17 +2131,17 @@ static const struct net_device_ops macb_netdev_ops = {
 };
 
 #if defined(CONFIG_OF)
-static struct macb_config pc302gem_config = {
+static const struct macb_config pc302gem_config = {
 	.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
 	.dma_burst_length = 16,
 };
 
-static struct macb_config sama5d3_config = {
+static const struct macb_config sama5d3_config = {
 	.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
 	.dma_burst_length = 16,
 };
 
-static struct macb_config sama5d4_config = {
+static const struct macb_config sama5d4_config = {
 	.caps = 0,
 	.dma_burst_length = 4,
 };
@@ -2172,7 +2172,7 @@ static void macb_configure_caps(struct macb *bp)
 	if (bp->pdev->dev.of_node) {
 		match = of_match_node(macb_dt_ids, bp->pdev->dev.of_node);
 		if (match && match->data) {
-			config = (const struct macb_config *)match->data;
+			config = match->data;
 
 			bp->caps = config->caps;
 			/*
-- 
2.3.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: macb: constify macb configuration data
  2015-03-09 16:14 [PATCH] net: macb: constify macb configuration data Josh Cartwright
@ 2015-03-09 19:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-03-09 19:54 UTC (permalink / raw)
  To: joshc; +Cc: nicolas.ferre, netdev, linux-kernel

From: Josh Cartwright <joshc@ni.com>
Date: Mon, 9 Mar 2015 11:14:39 -0500

> The configurations are not modified by the driver.  Make them 'const' so
> that they may be placed in a read-only section.
> 
> Signed-off-by: Josh Cartwright <joshc@ni.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-09 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 16:14 [PATCH] net: macb: constify macb configuration data Josh Cartwright
2015-03-09 19:54 ` David Miller

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).