Loading drivers/platform/msm/ipa/test/ipa_ut_framework.c +14 −22 Original line number Diff line number Diff line /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -48,12 +48,14 @@ struct ipa_ut_context { /** * struct ipa_ut_dbgfs_test_write_work_ctx - work_queue context * @dbgfs: work_struct for the write_work * @file: file to be writen to * @dbgfs_Work: work_struct for the write_work * @meta_type: See enum ipa_ut_meta_test_type * @user_data: user data usually used to point to suite or test object */ struct ipa_ut_dbgfs_test_write_work_ctx { struct work_struct dbgfs_work; struct file *file; long meta_type; void *user_data; }; static ssize_t ipa_ut_dbgfs_enable_read(struct file *file, Loading Loading @@ -218,7 +220,6 @@ static void ipa_ut_dbgfs_meta_test_write_work_func(struct work_struct *work) { struct ipa_ut_dbgfs_test_write_work_ctx *write_work_ctx; struct ipa_ut_suite *suite; struct file *file; int i; enum ipa_hw_type ipa_ver; int rc = 0; Loading @@ -231,14 +232,9 @@ static void ipa_ut_dbgfs_meta_test_write_work_func(struct work_struct *work) IPA_UT_DBG("Entry\n"); mutex_lock(&ipa_ut_ctx->lock); file = write_work_ctx->file; if (file == NULL) { rc = -EFAULT; goto unlock_mutex; } suite = file->f_inode->i_private; suite = (struct ipa_ut_suite *)(write_work_ctx->user_data); ipa_assert_on(!suite); meta_type = (long)(file->private_data); meta_type = write_work_ctx->meta_type; IPA_UT_DBG("Meta test type %ld\n", meta_type); _IPA_UT_TEST_LOG_BUF_NAME = kzalloc(_IPA_UT_TEST_LOG_BUF_SIZE, Loading Loading @@ -353,7 +349,7 @@ static void ipa_ut_dbgfs_meta_test_write_work_func(struct work_struct *work) } /* * ipa_ut_dbgfs_meta_test_write() - Debugfs write func for a for a meta test * ipa_ut_dbgfs_meta_test_write() - Debugfs write func for a meta test * @params: write fops * * Run all tests in a suite using a work queue so it does not race with Loading @@ -372,7 +368,8 @@ static ssize_t ipa_ut_dbgfs_meta_test_write(struct file *file, return -ENOMEM; } write_work_ctx->file = file; write_work_ctx->user_data = file->f_inode->i_private; write_work_ctx->meta_type = (long)(file->private_data); INIT_WORK(&write_work_ctx->dbgfs_work, ipa_ut_dbgfs_meta_test_write_work_func); Loading Loading @@ -514,7 +511,6 @@ static void ipa_ut_dbgfs_test_write_work_func(struct work_struct *work) struct ipa_ut_dbgfs_test_write_work_ctx *write_work_ctx; struct ipa_ut_test *test; struct ipa_ut_suite *suite; struct file *file; bool tst_fail = false; int rc = 0; enum ipa_hw_type ipa_ver; Loading @@ -525,12 +521,7 @@ static void ipa_ut_dbgfs_test_write_work_func(struct work_struct *work) IPA_UT_DBG("Entry\n"); mutex_lock(&ipa_ut_ctx->lock); file = write_work_ctx->file; if (file == NULL) { rc = -EFAULT; goto unlock_mutex; } test = file->f_inode->i_private; test = (struct ipa_ut_test *)(write_work_ctx->user_data); ipa_assert_on(!test); _IPA_UT_TEST_LOG_BUF_NAME = kzalloc(_IPA_UT_TEST_LOG_BUF_SIZE, Loading Loading @@ -632,7 +623,8 @@ static ssize_t ipa_ut_dbgfs_test_write(struct file *file, return -ENOMEM; } write_work_ctx->file = file; write_work_ctx->user_data = file->f_inode->i_private; write_work_ctx->meta_type = (long)(file->private_data); INIT_WORK(&write_work_ctx->dbgfs_work, ipa_ut_dbgfs_test_write_work_func); Loading Loading
drivers/platform/msm/ipa/test/ipa_ut_framework.c +14 −22 Original line number Diff line number Diff line /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -48,12 +48,14 @@ struct ipa_ut_context { /** * struct ipa_ut_dbgfs_test_write_work_ctx - work_queue context * @dbgfs: work_struct for the write_work * @file: file to be writen to * @dbgfs_Work: work_struct for the write_work * @meta_type: See enum ipa_ut_meta_test_type * @user_data: user data usually used to point to suite or test object */ struct ipa_ut_dbgfs_test_write_work_ctx { struct work_struct dbgfs_work; struct file *file; long meta_type; void *user_data; }; static ssize_t ipa_ut_dbgfs_enable_read(struct file *file, Loading Loading @@ -218,7 +220,6 @@ static void ipa_ut_dbgfs_meta_test_write_work_func(struct work_struct *work) { struct ipa_ut_dbgfs_test_write_work_ctx *write_work_ctx; struct ipa_ut_suite *suite; struct file *file; int i; enum ipa_hw_type ipa_ver; int rc = 0; Loading @@ -231,14 +232,9 @@ static void ipa_ut_dbgfs_meta_test_write_work_func(struct work_struct *work) IPA_UT_DBG("Entry\n"); mutex_lock(&ipa_ut_ctx->lock); file = write_work_ctx->file; if (file == NULL) { rc = -EFAULT; goto unlock_mutex; } suite = file->f_inode->i_private; suite = (struct ipa_ut_suite *)(write_work_ctx->user_data); ipa_assert_on(!suite); meta_type = (long)(file->private_data); meta_type = write_work_ctx->meta_type; IPA_UT_DBG("Meta test type %ld\n", meta_type); _IPA_UT_TEST_LOG_BUF_NAME = kzalloc(_IPA_UT_TEST_LOG_BUF_SIZE, Loading Loading @@ -353,7 +349,7 @@ static void ipa_ut_dbgfs_meta_test_write_work_func(struct work_struct *work) } /* * ipa_ut_dbgfs_meta_test_write() - Debugfs write func for a for a meta test * ipa_ut_dbgfs_meta_test_write() - Debugfs write func for a meta test * @params: write fops * * Run all tests in a suite using a work queue so it does not race with Loading @@ -372,7 +368,8 @@ static ssize_t ipa_ut_dbgfs_meta_test_write(struct file *file, return -ENOMEM; } write_work_ctx->file = file; write_work_ctx->user_data = file->f_inode->i_private; write_work_ctx->meta_type = (long)(file->private_data); INIT_WORK(&write_work_ctx->dbgfs_work, ipa_ut_dbgfs_meta_test_write_work_func); Loading Loading @@ -514,7 +511,6 @@ static void ipa_ut_dbgfs_test_write_work_func(struct work_struct *work) struct ipa_ut_dbgfs_test_write_work_ctx *write_work_ctx; struct ipa_ut_test *test; struct ipa_ut_suite *suite; struct file *file; bool tst_fail = false; int rc = 0; enum ipa_hw_type ipa_ver; Loading @@ -525,12 +521,7 @@ static void ipa_ut_dbgfs_test_write_work_func(struct work_struct *work) IPA_UT_DBG("Entry\n"); mutex_lock(&ipa_ut_ctx->lock); file = write_work_ctx->file; if (file == NULL) { rc = -EFAULT; goto unlock_mutex; } test = file->f_inode->i_private; test = (struct ipa_ut_test *)(write_work_ctx->user_data); ipa_assert_on(!test); _IPA_UT_TEST_LOG_BUF_NAME = kzalloc(_IPA_UT_TEST_LOG_BUF_SIZE, Loading Loading @@ -632,7 +623,8 @@ static ssize_t ipa_ut_dbgfs_test_write(struct file *file, return -ENOMEM; } write_work_ctx->file = file; write_work_ctx->user_data = file->f_inode->i_private; write_work_ctx->meta_type = (long)(file->private_data); INIT_WORK(&write_work_ctx->dbgfs_work, ipa_ut_dbgfs_test_write_work_func); Loading