Make #include guard naming consistent

Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/2956
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
Marc Schink
2015-09-21 21:07:46 +02:00
committed by Andreas Fritiofson
parent d0e763ac7e
commit d4b7cbff88
164 changed files with 544 additions and 463 deletions

View File

@@ -72,6 +72,25 @@ Finally, try to avoid lines of code that are longer than than 72-80 columns:
- use underline characters between consecutive words in identifiers
(e.g. @c more_than_one_word).
@section style_include_guards Include Guards
Every header file should have a unique include guard to prevent multiple
inclusion.
To guarantee uniqueness, an include guard should be based on the filename and
the full path in the project source tree.
For the header file src/helper/jim-nvp.h, the include guard would look like
this:
@code
#ifndef OPENOCD_HELPER_JIM_NVP_H
#define OPENOCD_HELPER_JIM_NVP_H
/* Your code here. */
#endif /* OPENOCD_HELPER_JIM_NVP_H */
@endcode
@section stylec99 C99 Rules
- inline functions

View File

@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_COMMON_H
#define FLASH_COMMON_H
#ifndef OPENOCD_FLASH_COMMON_H
#define OPENOCD_FLASH_COMMON_H
#include <helper/log.h>
@@ -45,4 +45,4 @@ bool flash_driver_name_matches(const char *name, const char *expected);
#define ERROR_FLASH_BANK_NOT_PROBED (-907)
#define ERROR_FLASH_OPER_UNSUPPORTED (-908)
#endif /* FLASH_COMMON_H */
#endif /* OPENOCD_FLASH_COMMON_H */

View File

@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef _MFLASH_H
#define _MFLASH_H
#ifndef OPENOCD_FLASH_MFLASH_H
#define OPENOCD_FLASH_MFLASH_H
struct command_context;
@@ -286,4 +286,4 @@ typedef enum _mg_opmode {
mg_op_mode_stg = 0 /* Only Storage */
} mg_opmode;
#endif
#endif /* OPENOCD_FLASH_MFLASH_H */

View File

@@ -14,8 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ARM_NANDIO_H
#define __ARM_NANDIO_H
#ifndef OPENOCD_FLASH_NAND_ARM_IO_H
#define OPENOCD_FLASH_NAND_ARM_IO_H
/**
* Available operational states the arm_nand_data struct can be in.
@@ -52,4 +52,4 @@ struct arm_nand_data {
int arm_nandwrite(struct arm_nand_data *nand, uint8_t *data, int size);
int arm_nandread(struct arm_nand_data *nand, uint8_t *data, uint32_t size);
#endif /* __ARM_NANDIO_H */
#endif /* OPENOCD_FLASH_NAND_ARM_IO_H */

View File

@@ -21,8 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_NAND_CORE_H
#define FLASH_NAND_CORE_H
#ifndef OPENOCD_FLASH_NAND_CORE_H
#define OPENOCD_FLASH_NAND_CORE_H
#include <flash/common.h>
@@ -229,4 +229,4 @@ COMMAND_HELPER(nand_command_get_device, unsigned name_index,
#define ERROR_NAND_ERROR_CORRECTION_FAILED (-1105)
#define ERROR_NAND_NO_BUFFER (-1106)
#endif /* FLASH_NAND_CORE_H */
#endif /* OPENOCD_FLASH_NAND_CORE_H */

View File

@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_NAND_DRIVER_H
#define FLASH_NAND_DRIVER_H
#ifndef OPENOCD_FLASH_NAND_DRIVER_H
#define OPENOCD_FLASH_NAND_DRIVER_H
struct nand_device;
@@ -100,4 +100,4 @@ typedef int (*nand_driver_walker_t)(struct nand_flash_controller *c, void *);
*/
int nand_driver_walk(nand_driver_walker_t f, void *x);
#endif /* FLASH_NAND_DRIVER_H */
#endif /* OPENOCD_FLASH_NAND_DRIVER_H */

View File

@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_NAND_FILEIO_H
#define FLASH_NAND_FILEIO_H
#ifndef OPENOCD_FLASH_NAND_FILEIO_H
#define OPENOCD_FLASH_NAND_FILEIO_H
#include <helper/time_support.h>
#include <helper/fileio.h>
@@ -53,4 +53,4 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
int nand_fileio_read(struct nand_device *nand, struct nand_fileio_state *s);
#endif /* FLASH_NAND_FILEIO_H */
#endif /* OPENOCD_FLASH_NAND_FILEIO_H */

View File

@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_NAND_IMP_H
#define FLASH_NAND_IMP_H
#ifndef OPENOCD_FLASH_NAND_IMP_H
#define OPENOCD_FLASH_NAND_IMP_H
#include "core.h"
#include "driver.h"
@@ -35,4 +35,4 @@ int nand_probe(struct nand_device *nand);
int nand_erase(struct nand_device *nand, int first_block, int last_block);
int nand_build_bbt(struct nand_device *nand, int first, int last);
#endif /* FLASH_NAND_IMP_H */
#endif /* OPENOCD_FLASH_NAND_IMP_H */

View File

@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef LPC3180_NAND_CONTROLLER_H
#define LPC3180_NAND_CONTROLLER_H
#ifndef OPENOCD_FLASH_NAND_LPC3180_H
#define OPENOCD_FLASH_NAND_LPC3180_H
enum lpc3180_selected_controller {
LPC3180_NO_CONTROLLER,
@@ -34,4 +34,4 @@ struct lpc3180_nand_controller {
uint32_t sw_wp_upper_bound;
};
#endif /*LPC3180_NAND_CONTROLLER_H */
#endif /* OPENOCD_FLASH_NAND_LPC3180_H */

View File

@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef LPC32xx_NAND_CONTROLLER_H
#define LPC32xx_NAND_CONTROLLER_H
#ifndef OPENOCD_FLASH_NAND_LPC32XX_H
#define OPENOCD_FLASH_NAND_LPC32XX_H
enum lpc32xx_selected_controller {
LPC32xx_NO_CONTROLLER,
@@ -33,4 +33,4 @@ struct lpc32xx_nand_controller {
uint32_t sw_wp_upper_bound;
};
#endif /*LPC32xx_NAND_CONTROLLER_H */
#endif /* OPENOCD_FLASH_NAND_LPC32XX_H */

View File

@@ -17,6 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef OPENOCD_FLASH_NAND_MX3_H
#define OPENOCD_FLASH_NAND_MX3_H
/*
* Freescale iMX3* OpenOCD NAND Flash controller support.
*
@@ -105,3 +108,5 @@ struct mx3_nf_controller {
enum mx_nf_finalize_action fin;
struct mx3_nf_flags flags;
};
#endif /* OPENOCD_FLASH_NAND_MX3_H */

View File

@@ -1,4 +1,3 @@
/***************************************************************************
* Copyright (C) 2009 by Alexei Babich *
* Rezonans plc., Chelyabinsk, Russia *
@@ -21,6 +20,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef OPENOCD_FLASH_NAND_MXC_H
#define OPENOCD_FLASH_NAND_MXC_H
/*
* Freescale iMX OpenOCD NAND Flash controller support.
* based on Freescale iMX2* and iMX3* OpenOCD NAND Flash controller support.
@@ -162,3 +164,5 @@ struct mxc_nf_controller {
enum mxc_nf_finalize_action fin;
struct mxc_nf_flags flags;
};
#endif /* OPENOCD_FLASH_NAND_MXC_H */

View File

@@ -20,8 +20,8 @@
* NAND controller interface for Nuvoton NUC910
*/
#ifndef NUC910_H
#define NUC910_H
#ifndef OPENOCD_FLASH_NAND_NUC910_H
#define OPENOCD_FLASH_NAND_NUC910_H
#define NUC910_FMICSR 0xB000D000
#define NUC910_SMCSR 0xB000D0A0
@@ -54,5 +54,4 @@
/* ECC4 Correction Status (ECC4ST) */
#endif /* NUC910_H */
#endif /* OPENOCD_FLASH_NAND_NUC910_H */

View File

@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef S3C24xx_NAND_H
#define S3C24xx_NAND_H
#ifndef OPENOCD_FLASH_NAND_S3C24XX_H
#define OPENOCD_FLASH_NAND_S3C24XX_H
/*
* S3C24XX Series OpenOCD NAND Flash controller support.
@@ -75,4 +75,4 @@ int s3c2440_read_block_data(struct nand_device *nand,
int s3c2440_write_block_data(struct nand_device *nand,
uint8_t *data, int data_size);
#endif /* S3C24xx_NAND_H */
#endif /* OPENOCD_FLASH_NAND_S3C24XX_H */

View File

@@ -20,8 +20,8 @@
* S3C2410 NAND register definitions
*/
#ifndef __ASM_ARM_REGS_NAND
#define __ASM_ARM_REGS_NAND
#ifndef OPENOCD_FLASH_NAND_S3C24XX_REGS_H
#define OPENOCD_FLASH_NAND_S3C24XX_REGS_H
#define S3C2410_NFREG(x) (x)
@@ -126,5 +126,4 @@
#define S3C2412_NFECCERR_MULTIBIT (2)
#define S3C2412_NFECCERR_ECCAREA (3)
#endif /* __ASM_ARM_REGS_NAND */
#endif /* OPENOCD_FLASH_NAND_S3C24XX_REGS_H */

View File

@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef CFI_H
#define CFI_H
#ifndef OPENOCD_FLASH_NOR_CFI_H
#define OPENOCD_FLASH_NOR_CFI_H
#define CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7 0xE0 /* DQ5..DQ7 */
#define CFI_STATUS_POLL_MASK_DQ6_DQ7 0xC0 /* DQ6..DQ7 */
@@ -159,4 +159,4 @@ struct cfi_fixup {
#define CFI_MFR_ANY 0xffff
#define CFI_ID_ANY 0xffff
#endif /* CFI_H */
#endif /* OPENOCD_FLASH_NOR_CFI_H */

View File

@@ -19,8 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_NOR_CORE_H
#define FLASH_NOR_CORE_H
#ifndef OPENOCD_FLASH_NOR_CORE_H
#define OPENOCD_FLASH_NOR_CORE_H
#include <flash/common.h>
@@ -206,4 +206,4 @@ struct flash_bank *get_flash_bank_by_num_noprobe(int num);
int get_flash_bank_by_addr(struct target *target, uint32_t addr, bool check,
struct flash_bank **result_bank);
#endif /* FLASH_NOR_CORE_H */
#endif /* OPENOCD_FLASH_NOR_CORE_H */

View File

@@ -19,8 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_NOR_DRIVER_H
#define FLASH_NOR_DRIVER_H
#ifndef OPENOCD_FLASH_NOR_DRIVER_H
#define OPENOCD_FLASH_NOR_DRIVER_H
struct flash_bank;
@@ -221,4 +221,4 @@ struct flash_driver {
*/
struct flash_driver *flash_driver_find_by_name(const char *name);
#endif /* FLASH_NOR_DRIVER_H */
#endif /* OPENOCD_FLASH_NOR_DRIVER_H */

View File

@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FLASH_NOR_IMP_H
#define FLASH_NOR_IMP_H
#ifndef OPENOCD_FLASH_NOR_IMP_H
#define OPENOCD_FLASH_NOR_IMP_H
/* this is an internal header */
#include "core.h"
@@ -46,4 +46,4 @@ int flash_driver_read(struct flash_bank *bank,
int flash_write_unlock(struct target *target, struct image *image,
uint32_t *written, int erase, bool unlock);
#endif /* FLASH_NOR_IMP_H */
#endif /* OPENOCD_FLASH_NOR_IMP_H */

View File

@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef NON_CFI_H
#define NON_CFI_H
#ifndef OPENOCD_FLASH_NOR_NON_CFI_H
#define OPENOCD_FLASH_NOR_NON_CFI_H
struct non_cfi {
uint16_t mfr;
@@ -33,4 +33,4 @@ struct non_cfi {
void cfi_fixup_non_cfi(struct flash_bank *bank);
#endif /* NON_CFI_H */
#endif /* OPENOCD_FLASH_NOR_NON_CFI_H */

Some files were not shown because too many files have changed in this diff Show More