Commit Graph

11 Commits

Author SHA1 Message Date
johpow01 d471bd9cfc IO Driver Misra Cleanup
This patch cleans up MISRA C violations in the IO driver files.  Some
things did not make sense to fix or would require sweeping changes
but the simple issues have been resolved.

Defects Fixed

File                        Line Rule
drivers/io/io_fip.c         39   MISRA C-2012 Rule 5.6 (required)
drivers/io/io_fip.c         52   MISRA C-2012 Rule 8.9 (advisory)
drivers/io/io_fip.c         60   MISRA C-2012 Rule 5.9 (advisory)
drivers/io/io_fip.c         285  MISRA C-2012 Rule 8.9 (advisory)
drivers/io/io_fip.c         336  MISRA C-2012 Rule 15.4 (advisory)
drivers/io/io_fip.c         340  MISRA C-2012 Rule 15.4 (advisory)
drivers/io/io_fip.c         342  MISRA C-2012 Rule 15.4 (advisory)
drivers/io/io_memmap.c      30   MISRA C-2012 Rule 5.6 (required)
drivers/io/io_memmap.c      32   MISRA C-2012 Rule 5.9 (advisory)
drivers/io/io_memmap.c      85   MISRA C-2012 Rule 11.8 (required)
drivers/io/io_semihosting.c 66   MISRA C-2012 Rule 11.8 (required)
drivers/io/io_storage.c     73   MISRA C-2012 Rule 5.9 (advisory)
drivers/io/io_storage.c     116  MISRA C-2012 Rule 13.4 (advisory)

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Id9b1b2b684588d4eaab674ed4ed04f3950dd21f4
2020-07-16 13:10:23 -05:00
Masahiro Yamada a1ab463a9d io_storage: remove redundant assigments
The assignments to 'result' are unneeded.

Change-Id: I18899f10bf9bd7f219f0e47a981683d8b4701bde
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-07-09 22:27:47 +09:00
Yann Gautier 70cb0bff7d io: change seek offset to signed long long
IO seek offset can be set to values above UINT32_MAX, this change
changes the seek offset argument from 'ssize_t' to 'signed long long'.
Fixing platform seek functions to match the new interface update.

Change-Id: I25de83b3b7abe5f52a7b0fee36f71e60cac9cfcb
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
2020-01-10 21:14:57 +01:00
Paul Beesley 9a2fffb800 drivers: Remove TODO from io_storage
This TODO was added five years ago so I assume that there is not
going to be a shutdown API added after all.

Change-Id: If0f4e2066454df773bd9bf41ed65d3a10248a2d3
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-03-12 13:42:08 +00:00
Antonio Nino Diaz 09d40e0e08 Sanitise includes across codebase
Enforce full include path for includes. Deprecate old paths.

The following folders inside include/lib have been left unchanged:

- include/lib/cpus/${ARCH}
- include/lib/el3_runtime/${ARCH}

The reason for this change is that having a global namespace for
includes isn't a good idea. It defeats one of the advantages of having
folders and it introduces problems that are sometimes subtle (because
you may not know the header you are actually including if there are two
of them).

For example, this patch had to be created because two headers were
called the same way: e0ea0928d5 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a2 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca33988 ("Move include and
source files to logical locations"). At that time, there weren't too
many headers so it wasn't a real issue. However, time has shown that
this creates problems.

Platforms that want to preserve the way they include headers may add the
removed paths to PLAT_INCLUDES, but this is discouraged.

Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-04 10:43:17 +00:00
Konstantin Porotchkin 255f5c8f88 io: Allow image load to address zero
Remove assert on buffer address equal zero.
Marvell uses address 0x0 for loading BL33,
so this check is irrelevant and breaks the
debug builds on Marvell platforms.

Change-Id: Ie56a51138e2e4ddd8986dd7036797dc2d8b10125
Signed-off-by: Haim Boot <hayim@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/54589
2018-07-18 18:48:30 +03:00
Etienne Carriere 5a8e2aeec4 io_storage: use unsigned int for index
This change avoids warning about type conversion.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2017-06-23 09:38:13 +02:00
dp-arm 82cb2c1ad9 Use SPDX license identifiers
To make software license auditing simpler, use SPDX[0] license
identifiers instead of duplicating the license text in every file.

NOTE: Files that have been imported by FreeBSD have not been modified.

[0]: https://spdx.org/

Change-Id: I80a00e1f641b8cc075ca5a95b10607ed9ed8761a
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
2017-05-03 09:39:28 +01:00
Antonio Nino Diaz aa61368eb5 Control inclusion of helper code used for asserts
Many asserts depend on code that is conditionally compiled based on the
DEBUG define. This patch modifies the conditional inclusion of such code
so that it is based on the ENABLE_ASSERTIONS build option.

Change-Id: I6406674788aa7e1ad7c23d86ce94482ad3c382bd
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2017-04-20 09:59:12 +01:00
Juan Castillo e098e244a2 Remove deprecated IO return definitions
Patch 7e26fe1f deprecates IO specific return definitions in favour
of standard errno codes. This patch removes those definitions
and its usage from the IO framework, IO drivers and IO platform
layer. Following this patch, standard errno codes must be used
when checking the return value of an IO function.

Change-Id: Id6e0e9d0a7daf15a81ec598cf74de83d5768650f
2015-11-02 10:47:01 +00:00
Dan Handley 935db69328 Move IO storage source to drivers directory
Move the remaining IO storage source file (io_storage.c) from the
lib to the drivers directory. This requires that platform ports
explicitly add this file to the list of source files.

Also move the IO header files to a new sub-directory, include/io.

Change-Id: I862b1252a796b3bcac0d93e50b11e7fb2ded93d6
2014-08-14 11:17:03 +01:00