intel_gpu_top: adopt to kernel coding style

This patch fixes adopts the code to the kernel coding_style.
This commit is contained in:
Eugeni Dodonov 2011-09-05 19:50:52 -03:00
parent a483c97d91
commit b9d7c3a087

View File

@ -454,8 +454,7 @@ int main(int argc, char **argv)
char *cmd=NULL; char *cmd=NULL;
/* Parse options? */ /* Parse options? */
while ((ch = getopt(argc, argv, "s:o:e:h")) != -1) while ((ch = getopt(argc, argv, "s:o:e:h")) != -1) {
{
switch (ch) { switch (ch) {
case 'e': cmd = strdup(optarg); case 'e': cmd = strdup(optarg);
break; break;
@ -487,15 +486,13 @@ int main(int argc, char **argv)
argv += optind; argv += optind;
/* Do we have a command to run? */ /* Do we have a command to run? */
if (cmd != NULL) if (cmd != NULL) {
{
if (output != stdout) { if (output != stdout) {
fprintf(output, "# Profiling: %s\n", cmd); fprintf(output, "# Profiling: %s\n", cmd);
fflush(output); fflush(output);
} }
child_pid = fork(); child_pid = fork();
if (child_pid < 0) if (child_pid < 0) {
{
perror("fork"); perror("fork");
exit(1); exit(1);
} }
@ -511,8 +508,7 @@ int main(int argc, char **argv)
fflush(output); fflush(output);
} }
exit(0); exit(0);
} } else {
else {
free(cmd); free(cmd);
} }
} }
@ -711,8 +707,7 @@ int main(int argc, char **argv)
} }
/* Check if child has gone */ /* Check if child has gone */
if (child_pid > 0) if (child_pid > 0) {
{
int res; int res;
if ((res = waitpid(child_pid, &child_stat, WNOHANG)) == -1) { if ((res = waitpid(child_pid, &child_stat, WNOHANG)) == -1) {
perror("waitpid"); perror("waitpid");