sched: Remove the unnecessary cast from pid_t to int

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-06-19 04:20:04 +08:00 committed by Petro Karashchenko
parent 07b0cd1cba
commit a8e0a5faa4
8 changed files with 15 additions and 15 deletions

View File

@ -294,7 +294,7 @@ int exec_module(FAR struct binary_s *binp,
} }
#endif #endif
return (int)pid; return pid;
errout_with_tcbinit: errout_with_tcbinit:
#ifndef CONFIG_BUILD_KERNEL #ifndef CONFIG_BUILD_KERNEL

View File

@ -847,14 +847,14 @@ static int procfs_readdir(FAR struct inode *mountpt,
FAR struct tcb_s *tcb = nxsched_get_tcb(pid); FAR struct tcb_s *tcb = nxsched_get_tcb(pid);
if (!tcb) if (!tcb)
{ {
ferr("ERROR: PID %d is no longer valid\n", (int)pid); ferr("ERROR: PID %d is no longer valid\n", pid);
return -ENOENT; return -ENOENT;
} }
/* Save the filename=pid and file type=directory */ /* Save the filename=pid and file type=directory */
entry->d_type = DTYPE_DIRECTORY; entry->d_type = DTYPE_DIRECTORY;
procfs_snprintf(entry->d_name, NAME_MAX + 1, "%d", (int)pid); procfs_snprintf(entry->d_name, NAME_MAX + 1, "%d", pid);
/* Set up the next directory entry offset. NOTE that we could use /* Set up the next directory entry offset. NOTE that we could use
* the standard f_pos instead of our own private index. * the standard f_pos instead of our own private index.

View File

@ -1474,7 +1474,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath,
tcb = nxsched_get_tcb(pid); tcb = nxsched_get_tcb(pid);
if (tcb == NULL) if (tcb == NULL)
{ {
ferr("ERROR: PID %d is no longer valid\n", (int)pid); ferr("ERROR: PID %d is no longer valid\n", pid);
return -ENOENT; return -ENOENT;
} }
@ -1561,7 +1561,7 @@ static ssize_t proc_read(FAR struct file *filep, FAR char *buffer,
tcb = nxsched_get_tcb(procfile->pid); tcb = nxsched_get_tcb(procfile->pid);
if (tcb == NULL) if (tcb == NULL)
{ {
ferr("ERROR: PID %d is not valid\n", (int)procfile->pid); ferr("ERROR: PID %d is not valid\n", procfile->pid);
return -ENODEV; return -ENODEV;
} }
@ -1651,7 +1651,7 @@ static ssize_t proc_write(FAR struct file *filep, FAR const char *buffer,
tcb = nxsched_get_tcb(procfile->pid); tcb = nxsched_get_tcb(procfile->pid);
if (tcb == NULL) if (tcb == NULL)
{ {
ferr("ERROR: PID %d is not valid\n", (int)procfile->pid); ferr("ERROR: PID %d is not valid\n", procfile->pid);
return -ENODEV; return -ENODEV;
} }
@ -1780,7 +1780,7 @@ static int proc_opendir(FAR const char *relpath,
tcb = nxsched_get_tcb(pid); tcb = nxsched_get_tcb(pid);
if (tcb == NULL) if (tcb == NULL)
{ {
ferr("ERROR: PID %d is not valid\n", (int)pid); ferr("ERROR: PID %d is not valid\n", pid);
return -ENOENT; return -ENOENT;
} }
@ -1900,7 +1900,7 @@ static int proc_readdir(FAR struct fs_dirent_s *dir,
tcb = nxsched_get_tcb(pid); tcb = nxsched_get_tcb(pid);
if (tcb == NULL) if (tcb == NULL)
{ {
ferr("ERROR: PID %d is no longer valid\n", (int)pid); ferr("ERROR: PID %d is no longer valid\n", pid);
return -ENOENT; return -ENOENT;
} }
@ -2018,7 +2018,7 @@ static int proc_stat(const char *relpath, struct stat *buf)
tcb = nxsched_get_tcb(pid); tcb = nxsched_get_tcb(pid);
if (tcb == NULL) if (tcb == NULL)
{ {
ferr("ERROR: PID %d is no longer valid\n", (int)pid); ferr("ERROR: PID %d is no longer valid\n", pid);
return -ENOENT; return -ENOENT;
} }

View File

@ -506,7 +506,7 @@ void mempool_memdump(FAR struct mempool_s *pool,
# endif # endif
syslog(LOG_INFO, "%6d%12zu%12lu%*p%s\n", syslog(LOG_INFO, "%6d%12zu%12lu%*p%s\n",
(int)buf->pid, blocksize, buf->seqno, buf->pid, blocksize, buf->seqno,
MM_PTR_FMT_WIDTH, ((FAR char *)buf - blocksize), tmp); MM_PTR_FMT_WIDTH, ((FAR char *)buf - blocksize), tmp);
} }
} }

View File

@ -85,7 +85,7 @@ static void memdump_handler(FAR struct mm_allocnode_s *node, FAR void *arg)
# endif # endif
syslog(LOG_INFO, "%6d%12zu%12lu%*p%s\n", syslog(LOG_INFO, "%6d%12zu%12lu%*p%s\n",
(int)node->pid, nodesize, node->seqno, node->pid, nodesize, node->seqno,
MM_PTR_FMT_WIDTH, MM_PTR_FMT_WIDTH,
((FAR char *)node + SIZEOF_MM_ALLOCNODE), buf); ((FAR char *)node + SIZEOF_MM_ALLOCNODE), buf);
#endif #endif

View File

@ -430,7 +430,7 @@ static void memdump_handler(FAR void *ptr, size_t size, int used,
# endif # endif
syslog(LOG_INFO, "%6d%12zu%12lu%*p%s\n", syslog(LOG_INFO, "%6d%12zu%12lu%*p%s\n",
(int)buf->pid, size, buf->seqno, MM_PTR_FMT_WIDTH, buf->pid, size, buf->seqno, MM_PTR_FMT_WIDTH,
ptr, tmp); ptr, tmp);
#endif #endif
} }

View File

@ -110,7 +110,7 @@ int nxthread_create(FAR const char *name, uint8_t ttype, int priority,
nxtask_activate(&tcb->cmn); nxtask_activate(&tcb->cmn);
return (int)pid; return pid;
} }
/**************************************************************************** /****************************************************************************

View File

@ -129,7 +129,7 @@ static int nxtask_spawn_create(FAR const char *name, int priority,
nxtask_activate(&tcb->cmn); nxtask_activate(&tcb->cmn);
return (int)pid; return pid;
} }
/**************************************************************************** /****************************************************************************
@ -341,7 +341,7 @@ int task_spawn(FAR const char *name, main_t entry,
file_actions != NULL ? *file_actions : NULL, file_actions != NULL ? *file_actions : NULL,
attr, argv, envp); attr, argv, envp);
return ret >= 0 ? (int)pid : ret; return ret >= 0 ? pid : ret;
} }
#endif /* CONFIG_BUILD_KERNEL */ #endif /* CONFIG_BUILD_KERNEL */