Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1464616 > unrolled thread

[PATCH] atm: fore200e: Do not drop const qualifier

Started byLABBE Corentin <clabbe.montjoie@gmail.com>
First post2016-08-17 17:10 +0200
Last post2016-08-19 09:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] atm: fore200e: Do not drop const qualifier LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-17 17:10 +0200
    Re: [PATCH] atm: fore200e: Do not drop const qualifier David Miller <davem@davemloft.net> - 2016-08-19 09:00 +0200

#1464616 — [PATCH] atm: fore200e: Do not drop const qualifier

FromLABBE Corentin <clabbe.montjoie@gmail.com>
Date2016-08-17 17:10 +0200
Subject[PATCH] atm: fore200e: Do not drop const qualifier
Message-ID<s7aDE-2HU-9@gated-at.bofh.it>
The data member of structure firmware is const and this constness is
dropped by some cast.
This patch add some const for keeping the const information.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 drivers/atm/fore200e.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 75dde90..81aaa50 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -2489,7 +2489,7 @@ static int fore200e_load_and_start_fw(struct fore200e *fore200e)
 {
     const struct firmware *firmware;
     struct device *device;
-    struct fw_header *fw_header;
+    const struct fw_header *fw_header;
     const __le32 *fw_data;
     u32 fw_size;
     u32 __iomem *load_addr;
@@ -2511,9 +2511,9 @@ static int fore200e_load_and_start_fw(struct fore200e *fore200e)
 	return err;
     }
 
-    fw_data = (__le32 *) firmware->data;
+    fw_data = (const __le32 *)firmware->data;
     fw_size = firmware->size / sizeof(u32);
-    fw_header = (struct fw_header *) firmware->data;
+    fw_header = (const struct fw_header *)firmware->data;
     load_addr = fore200e->virt_base + le32_to_cpu(fw_header->load_offset);
 
     DPRINTK(2, "device %s firmware being loaded at 0x%p (%d words)\n",
-- 
2.7.3

[toc] | [next] | [standalone]


#1466072

FromDavid Miller <davem@davemloft.net>
Date2016-08-19 09:00 +0200
Message-ID<s7LWy-2b5-27@gated-at.bofh.it>
In reply to#1464616
From: LABBE Corentin <clabbe.montjoie@gmail.com>
Date: Wed, 17 Aug 2016 15:56:45 +0200

> The data member of structure firmware is const and this constness is
> dropped by some cast.
> This patch add some const for keeping the const information.
> 
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web