提交 673918d0 编写于 作者: O openharmony_ci 提交者: Gitee

!196 修改quickstart中codingstyle

Merge pull request !196 from boxi/master
......@@ -29,8 +29,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __LOS_QUICK_START_H__
#define __LOS_QUICK_START_H__
#ifndef __LOS_DEV_QUICKSTART_H__
#define __LOS_DEV_QUICKSTART_H__
#include "los_typedef.h"
#include "sys/ioctl.h"
......@@ -46,14 +46,14 @@ typedef enum {
QS_STAGE2, /* system init stage No 2 */
QS_STAGE3, /* system init stage No 3 */
QS_STAGE_LIMIT
} QS_STAGE;
} QuickstartStage;
typedef enum {
QS_UNREGISTER = QS_STAGE_LIMIT, /* quickstart dev unregister */
QS_NOTIFY, /* quickstart notify */
QS_LISTEN, /* quickstart listen */
QS_CTL_LIMIT
} QS_CTL;
} QuickstartConctrl;
#define QS_STAGE_CNT (QS_STAGE_LIMIT - QS_STAGE1)
......@@ -73,9 +73,9 @@ typedef struct {
SysteminitHook func[QS_STAGE_CNT];
} LosSysteminitHook;
extern void QuickStartHookRegister(LosSysteminitHook hooks);
extern void QuickstartHookRegister(LosSysteminitHook hooks);
extern int QuickStartDevRegister(void);
extern int QuickstartDevRegister(void);
#ifdef __cplusplus
#if __cplusplus
......
......@@ -59,14 +59,14 @@ static void QuickstartListen(unsigned int eventMask)
LOS_EventRead((PEVENT_CB_S)&g_qsEvent, eventMask, LOS_WAITMODE_AND | LOS_WAITMODE_CLR, LOS_WAIT_FOREVER);
}
void QuickStartHookRegister(LosSysteminitHook hooks)
void QuickstartHookRegister(LosSysteminitHook hooks)
{
for (int i = 0; i < QS_STAGE_CNT; i++) {
g_systemInitFunc[i] = hooks.func[i];
}
}
static void QuickStartStageWorking(unsigned int level)
static void QuickstartStageWorking(unsigned int level)
{
if ((level < QS_STAGE_CNT) && (g_callOnce[level] == 0) && (g_systemInitFunc[level] != NULL)) {
g_callOnce[level] = 1; /* 1: Already called */
......@@ -99,11 +99,8 @@ static ssize_t QuickstartIoctl(struct file *filep, int cmd, unsigned long arg)
case QUICKSTART_LISTEN:
QuickstartListen(arg);
break;
default:
QuickStartStageWorking(cmd - QUICKSTART_STAGE(1)); /* ioctl cmd converted to stage level */
QuickstartStageWorking(cmd - QUICKSTART_STAGE(1)); /* ioctl cmd converted to stage level */
break;
}
return 0;
......@@ -123,7 +120,7 @@ static const struct file_operations_vfs g_quickstartDevOps = {
NULL, /* unlink */
};
int QuickStartDevRegister(void)
int QuickstartDevRegister(void)
{
LOS_EventInit(&g_qsEvent);
return register_driver(QUICKSTART_NODE, &g_quickstartDevOps, 0666, 0); /* 0666: file mode */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册