PM5358 S/UNI-4x622 Driver Manual

Appendix A: Coding Conventions

Type

Case

Naming convention

Examples

 

 

 

 

Functions

Notation

 

 

 

 

 

 

Porting

Hungarian

prefix with “sys” and device name

sysSuni4x622Read()

Functions

Notation

 

 

 

 

 

 

Other

Hungarian

 

utilSuni4x622Valid

Functions

Notation

 

ateChan()

 

 

 

 

Variables

Hungarian

 

maxDevs

 

Notation

 

 

 

 

 

 

Pointers to

Hungarian

prefix variable name with “p”

pmaxDevs

variables

Notation

 

 

 

 

 

 

Global

Hungarian

prefix with device name

suni4x622Mdb

variables

Notation

 

 

 

 

 

 

Macros

Macro names must be all uppercase

Words shall be separated by an underscore

The letter ‘m’ in lowercase is used as a prefix to specify that it is a macro, then the device abbreviation must appear

Example: mSUNI4x622_GET_BIT is a valid name for a macro

Constants

Constant names must be all uppercase

Words shall be separated by an underscore

The device abbreviation must appear as a prefix

Example: SUNI4x622_MAX_POLL is a valid name for a constant

Structures

Structure names must be all uppercase

Words shall be separated by an underscore

The letter ‘s’ in lowercase must be used as a prefix to specify that it is a structure, then the device abbreviation must appear

Example: sSUNI4x622_DDB is a valid name for a structure

Proprietary and Confidential to PMC-Sierra, Inc.

122

Document ID: PMC-2010419, Issue 1

 

Page 122
Image 122
PMC-Sierra PM5358 S/UNI 4x622 manual Macros, Constants, Structures