* [U-Boot] [PATCH] fpga: Replace char * with const char * for filename
@ 2019-02-15 7:57 tien.fong.chee at intel.com
2019-02-18 12:27 ` Michal Simek
0 siblings, 1 reply; 4+ messages in thread
From: tien.fong.chee at intel.com @ 2019-02-15 7:57 UTC (permalink / raw)
To: u-boot
From: Tien Fong Chee <tien.fong.chee@intel.com>
Ensure the string for filename is always constant, otherwise it can be
corrupted by the writing.
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
---
drivers/fpga/zynqpl.c | 3 ++-
include/fpga.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c
index 499310d..683cf14 100644
--- a/drivers/fpga/zynqpl.c
+++ b/drivers/fpga/zynqpl.c
@@ -421,7 +421,8 @@ static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
loff_t blocksize, actread;
loff_t pos = 0;
int fstype;
- char *interface, *dev_part, *filename;
+ char *interface, *dev_part;
+ const char *filename;
blocksize = fsinfo->blocksize;
interface = fsinfo->interface;
diff --git a/include/fpga.h b/include/fpga.h
index 195f0bd..51de5c5 100644
--- a/include/fpga.h
+++ b/include/fpga.h
@@ -41,7 +41,7 @@ typedef struct { /* typedef fpga_desc */
unsigned int blocksize;
char *interface;
char *dev_part;
- char *filename;
+ const char *filename;
int fstype;
} fpga_fs_info;
--
1.7.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] fpga: Replace char * with const char * for filename
2019-02-15 7:57 [U-Boot] [PATCH] fpga: Replace char * with const char * for filename tien.fong.chee at intel.com
@ 2019-02-18 12:27 ` Michal Simek
2019-02-20 12:03 ` Chee, Tien Fong
0 siblings, 1 reply; 4+ messages in thread
From: Michal Simek @ 2019-02-18 12:27 UTC (permalink / raw)
To: u-boot
On 15. 02. 19 8:57, tien.fong.chee at intel.com wrote:
> From: Tien Fong Chee <tien.fong.chee@intel.com>
>
> Ensure the string for filename is always constant, otherwise it can be
> corrupted by the writing.
Have you reach any issue with it?
>
> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> ---
> drivers/fpga/zynqpl.c | 3 ++-
> include/fpga.h | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c
> index 499310d..683cf14 100644
> --- a/drivers/fpga/zynqpl.c
> +++ b/drivers/fpga/zynqpl.c
> @@ -421,7 +421,8 @@ static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
> loff_t blocksize, actread;
> loff_t pos = 0;
> int fstype;
> - char *interface, *dev_part, *filename;
> + char *interface, *dev_part;
> + const char *filename;
>
> blocksize = fsinfo->blocksize;
> interface = fsinfo->interface;
> diff --git a/include/fpga.h b/include/fpga.h
> index 195f0bd..51de5c5 100644
> --- a/include/fpga.h
> +++ b/include/fpga.h
> @@ -41,7 +41,7 @@ typedef struct { /* typedef fpga_desc */
> unsigned int blocksize;
> char *interface;
> char *dev_part;
> - char *filename;
> + const char *filename;
> int fstype;
> } fpga_fs_info;
>
>
Anyway looks good applied.
Thanks,
Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] fpga: Replace char * with const char * for filename
2019-02-18 12:27 ` Michal Simek
@ 2019-02-20 12:03 ` Chee, Tien Fong
2019-02-20 13:27 ` Michal Simek
0 siblings, 1 reply; 4+ messages in thread
From: Chee, Tien Fong @ 2019-02-20 12:03 UTC (permalink / raw)
To: u-boot
On Mon, 2019-02-18 at 13:27 +0100, Michal Simek wrote:
> On 15. 02. 19 8:57, tien.fong.chee at intel.com wrote:
> >
> > From: Tien Fong Chee <tien.fong.chee@intel.com>
> >
> > Ensure the string for filename is always constant, otherwise it can
> > be
> > corrupted by the writing.
> Have you reach any issue with it?
Just to resolve the compiler warning about missing of const.
>
> >
> >
> > Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> > ---
> > drivers/fpga/zynqpl.c | 3 ++-
> > include/fpga.h | 2 +-
> > 2 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c
> > index 499310d..683cf14 100644
> > --- a/drivers/fpga/zynqpl.c
> > +++ b/drivers/fpga/zynqpl.c
> > @@ -421,7 +421,8 @@ static int zynq_loadfs(xilinx_desc *desc, const
> > void *buf, size_t bsize,
> > loff_t blocksize, actread;
> > loff_t pos = 0;
> > int fstype;
> > - char *interface, *dev_part, *filename;
> > + char *interface, *dev_part;
> > + const char *filename;
> >
> > blocksize = fsinfo->blocksize;
> > interface = fsinfo->interface;
> > diff --git a/include/fpga.h b/include/fpga.h
> > index 195f0bd..51de5c5 100644
> > --- a/include/fpga.h
> > +++ b/include/fpga.h
> > @@ -41,7 +41,7 @@ typedef struct { /* typedef
> > fpga_desc */
> > unsigned int blocksize;
> > char *interface;
> > char *dev_part;
> > - char *filename;
> > + const char *filename;
> > int fstype;
> > } fpga_fs_info;
> >
> >
> Anyway looks good applied.
>
> Thanks,
> Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] fpga: Replace char * with const char * for filename
2019-02-20 12:03 ` Chee, Tien Fong
@ 2019-02-20 13:27 ` Michal Simek
0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2019-02-20 13:27 UTC (permalink / raw)
To: u-boot
On 20. 02. 19 13:03, Chee, Tien Fong wrote:
> On Mon, 2019-02-18 at 13:27 +0100, Michal Simek wrote:
>> On 15. 02. 19 8:57, tien.fong.chee at intel.com wrote:
>>>
>>> From: Tien Fong Chee <tien.fong.chee@intel.com>
>>>
>>> Ensure the string for filename is always constant, otherwise it can
>>> be
>>> corrupted by the writing.
>> Have you reach any issue with it?
> Just to resolve the compiler warning about missing of const.
ok.
Thanks,
Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-20 13:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 7:57 [U-Boot] [PATCH] fpga: Replace char * with const char * for filename tien.fong.chee at intel.com
2019-02-18 12:27 ` Michal Simek
2019-02-20 12:03 ` Chee, Tien Fong
2019-02-20 13:27 ` Michal Simek
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.