diff options
author | Edmond Chung <edmondchung@google.com> | 2023-04-05 17:13:30 -0700 |
---|---|---|
committer | Holmes Chou <holmeschou@google.com> | 2023-04-14 13:34:00 +0000 |
commit | f7f57cf2656919a6d4b0b9a0800e0695eda6e27c (patch) | |
tree | 6a7a5e4a2b7ae2125026ccac4f694c6f82124663 | |
parent | f51349f33ed7ff261298295c97820a0d646b3f8d (diff) | |
download | lwis-f7f57cf2656919a6d4b0b9a0800e0695eda6e27c.tar.gz |
Fix formatting.
Bug: 277134424
Test: No functional changes
Change-Id: If6709848fb9216fb15ff065c2724c50ab08eb313
Signed-off-by: Edmond Chung <edmondchung@google.com>
-rw-r--r-- | lwis_debug.c | 70 | ||||
-rw-r--r-- | lwis_device.h | 2 | ||||
-rw-r--r-- | lwis_device_dpm.c | 2 | ||||
-rw-r--r-- | lwis_device_i2c.c | 18 | ||||
-rw-r--r-- | lwis_device_i2c.h | 3 | ||||
-rw-r--r-- | lwis_device_ioreg.c | 7 | ||||
-rw-r--r-- | lwis_device_top.c | 12 | ||||
-rw-r--r-- | lwis_device_top.h | 1 | ||||
-rw-r--r-- | lwis_dt.c | 4 | ||||
-rw-r--r-- | lwis_event.c | 26 | ||||
-rw-r--r-- | lwis_fence.h | 27 | ||||
-rw-r--r-- | lwis_ioctl.c | 8 | ||||
-rw-r--r-- | lwis_ioreg.c | 8 | ||||
-rw-r--r-- | lwis_periodic_io.c | 8 | ||||
-rw-r--r-- | lwis_trace.h | 13 | ||||
-rw-r--r-- | lwis_util.c | 11 | ||||
-rw-r--r-- | lwis_util.h | 3 | ||||
-rw-r--r-- | platform/anchorage/lwis_platform_anchorage_dma.c | 4 |
18 files changed, 108 insertions, 119 deletions
diff --git a/lwis_debug.c b/lwis_debug.c index 5813476..a303a6d 100644 --- a/lwis_debug.c +++ b/lwis_debug.c @@ -195,16 +195,16 @@ static int generate_event_states_info(struct lwis_device *lwis_dev, char *buffer if (lwis_event_dump_cnt >= 0 && lwis_event_dump_cnt <= EVENT_DEBUG_HISTORY_SIZE) { scnprintf(tmp_buf, sizeof(tmp_buf), "=== LWIS DUMP LAST %d Received Events ===\n", - lwis_event_dump_cnt); + lwis_event_dump_cnt); strlcat(buffer, tmp_buf, buffer_size); traverse_last_events_size = lwis_event_dump_cnt; } else if (lwis_event_dump_cnt > EVENT_DEBUG_HISTORY_SIZE) { pr_err("lwis_event_dump_cnt (%d) exceed EVENT_DEBUG_HISTORY_SIZE (%d) \n", - lwis_event_dump_cnt, EVENT_DEBUG_HISTORY_SIZE); + lwis_event_dump_cnt, EVENT_DEBUG_HISTORY_SIZE); return -EINVAL; } else { scnprintf(buffer, buffer_size, "=== LWIS EVENT STATES INFO: %s ===\n", - lwis_dev->name); + lwis_dev->name); traverse_last_events_size = EVENT_DEBUG_HISTORY_SIZE; } @@ -320,7 +320,8 @@ static int generate_buffer_info(struct lwis_device *lwis_dev, char *buffer, size return 0; } -static int generate_register_io_history(struct lwis_device *lwis_dev, char *buffer, size_t buffer_size) +static int generate_register_io_history(struct lwis_device *lwis_dev, char *buffer, + size_t buffer_size) { /* Temporary buffer to be concatenated to the main buffer. */ char tmp_buf[128] = {}; @@ -340,40 +341,45 @@ static int generate_register_io_history(struct lwis_device *lwis_dev, char *buff /* Skip uninitialized entries */ if (reg_io->start_timestamp != 0) { if (reg_io->io_entry.type == LWIS_IO_ENTRY_READ) { - scnprintf(tmp_buf, sizeof(tmp_buf), - "READ: bid %d, offset %llu, val %llu, access_size %lu, start_timestamp %llu\n", - reg_io->io_entry.rw.bid, reg_io->io_entry.rw.offset, - reg_io->io_entry.rw.val, reg_io->access_size, - reg_io->start_timestamp); + scnprintf( + tmp_buf, sizeof(tmp_buf), + "READ: bid %d, offset %llu, val %llu, access_size %lu, start_timestamp %llu\n", + reg_io->io_entry.rw.bid, reg_io->io_entry.rw.offset, + reg_io->io_entry.rw.val, reg_io->access_size, + reg_io->start_timestamp); strlcat(buffer, tmp_buf, buffer_size); } else if (reg_io->io_entry.type == LWIS_IO_ENTRY_READ_BATCH) { - scnprintf(tmp_buf, sizeof(tmp_buf), - "READ_BATCH: bid %d, offset %llu, size_in_bytes %lu, access_size %lu, start_timestamp %llu\n", - reg_io->io_entry.rw_batch.bid, - reg_io->io_entry.rw_batch.offset, - reg_io->io_entry.rw_batch.size_in_bytes, - reg_io->access_size, reg_io->start_timestamp); + scnprintf( + tmp_buf, sizeof(tmp_buf), + "READ_BATCH: bid %d, offset %llu, size_in_bytes %lu, access_size %lu, start_timestamp %llu\n", + reg_io->io_entry.rw_batch.bid, + reg_io->io_entry.rw_batch.offset, + reg_io->io_entry.rw_batch.size_in_bytes, + reg_io->access_size, reg_io->start_timestamp); strlcat(buffer, tmp_buf, buffer_size); } else if (reg_io->io_entry.type == LWIS_IO_ENTRY_WRITE) { - scnprintf(tmp_buf, sizeof(tmp_buf), - "WRITE: bid %d, offset %llu, val %llu, access_size %lu, start_timestamp %llu\n", - reg_io->io_entry.rw.bid, reg_io->io_entry.rw.offset, - reg_io->io_entry.rw.val, reg_io->access_size, - reg_io->start_timestamp); + scnprintf( + tmp_buf, sizeof(tmp_buf), + "WRITE: bid %d, offset %llu, val %llu, access_size %lu, start_timestamp %llu\n", + reg_io->io_entry.rw.bid, reg_io->io_entry.rw.offset, + reg_io->io_entry.rw.val, reg_io->access_size, + reg_io->start_timestamp); strlcat(buffer, tmp_buf, buffer_size); } else if (reg_io->io_entry.type == LWIS_IO_ENTRY_WRITE_BATCH) { - scnprintf(tmp_buf, sizeof(tmp_buf), - "WRITE_BATCH: bid %d, offset %llu, size_in_bytes %lu, access_size %lu, start_timestamp %llu\n", - reg_io->io_entry.rw_batch.bid, - reg_io->io_entry.rw_batch.offset, - reg_io->io_entry.rw_batch.size_in_bytes, - reg_io->access_size, reg_io->start_timestamp); + scnprintf( + tmp_buf, sizeof(tmp_buf), + "WRITE_BATCH: bid %d, offset %llu, size_in_bytes %lu, access_size %lu, start_timestamp %llu\n", + reg_io->io_entry.rw_batch.bid, + reg_io->io_entry.rw_batch.offset, + reg_io->io_entry.rw_batch.size_in_bytes, + reg_io->access_size, reg_io->start_timestamp); strlcat(buffer, tmp_buf, buffer_size); } else if (reg_io->io_entry.type == LWIS_IO_ENTRY_MODIFY) { - scnprintf(tmp_buf, sizeof(tmp_buf), - "MODIFY: bid %d, offset %llu, access_size %lu, start_timestamp %llu\n", - reg_io->io_entry.mod.bid, reg_io->io_entry.mod.offset, - reg_io->access_size, reg_io->start_timestamp); + scnprintf( + tmp_buf, sizeof(tmp_buf), + "MODIFY: bid %d, offset %llu, access_size %lu, start_timestamp %llu\n", + reg_io->io_entry.mod.bid, reg_io->io_entry.mod.offset, + reg_io->access_size, reg_io->start_timestamp); strlcat(buffer, tmp_buf, buffer_size); } } @@ -688,8 +694,8 @@ int lwis_device_debugfs_setup(struct lwis_device *lwis_dev, struct dentry *dbg_r dbg_buffer_file = NULL; } - dbg_reg_io_file = - debugfs_create_file("io_history", 0444, dbg_dir, lwis_dev, ®ister_io_history_fops); + dbg_reg_io_file = debugfs_create_file("io_history", 0444, dbg_dir, lwis_dev, + ®ister_io_history_fops); if (IS_ERR_OR_NULL(dbg_reg_io_file)) { dev_warn(lwis_dev->dev, "Failed to create DebugFS io_history - %ld", PTR_ERR(dbg_reg_io_file)); diff --git a/lwis_device.h b/lwis_device.h index 393409f..2f30aa5 100644 --- a/lwis_device.h +++ b/lwis_device.h @@ -426,7 +426,7 @@ void lwis_device_crash_info_dump(struct lwis_device *lwis_dev); * for better debugability. */ void lwis_save_register_io_info(struct lwis_device *lwis_dev, struct lwis_io_entry *io_entry, - size_t access_size); + size_t access_size); /* * lwis_process_worker_queue: diff --git a/lwis_device_dpm.c b/lwis_device_dpm.c index 909928a..0adda1f 100644 --- a/lwis_device_dpm.c +++ b/lwis_device_dpm.c @@ -39,7 +39,7 @@ static struct lwis_event_subscribe_operations dpm_subscribe_ops = { }; static int find_bts_block(struct lwis_device *lwis_dev, struct lwis_device *target_dev, - struct lwis_qos_setting_v2 *qos_setting) + struct lwis_qos_setting_v2 *qos_setting) { int i; diff --git a/lwis_device_i2c.c b/lwis_device_i2c.c index efa9785..548a8d2 100644 --- a/lwis_device_i2c.c +++ b/lwis_device_i2c.c @@ -76,8 +76,7 @@ static int lwis_i2c_device_enable(struct lwis_device *lwis_dev) LWIS_ATRACE_FUNC_BEGIN(lwis_dev, "lwis_i2c_device_enable"); #if IS_ENABLED(CONFIG_INPUT_STMVL53L1) if (is_shared_i2c_with_stmvl53l1(i2c_dev->state_pinctrl)) - ret = shared_i2c_set_state(&i2c_dev->client->dev, - i2c_dev->state_pinctrl, + ret = shared_i2c_set_state(&i2c_dev->client->dev, i2c_dev->state_pinctrl, I2C_ON_STRING); else ret = lwis_i2c_set_state(i2c_dev, I2C_ON_STRING); @@ -111,13 +110,11 @@ static int lwis_i2c_device_disable(struct lwis_device *lwis_dev) if (is_shared_i2c_with_stmvl53l1(i2c_dev->state_pinctrl)) { /* Disable the shared i2c bus */ mutex_lock(i2c_dev->group_i2c_lock); - ret = shared_i2c_set_state(&i2c_dev->client->dev, - i2c_dev->state_pinctrl, + ret = shared_i2c_set_state(&i2c_dev->client->dev, i2c_dev->state_pinctrl, I2C_OFF_STRING); mutex_unlock(i2c_dev->group_i2c_lock); if (ret) { - dev_err(lwis_dev->dev, "Error disabling i2c bus (%d)\n", - ret); + dev_err(lwis_dev->dev, "Error disabling i2c bus (%d)\n", ret); } return ret; } @@ -280,19 +277,18 @@ static int lwis_i2c_device_probe(struct platform_device *plat_dev) /* Create associated kworker threads */ ret = lwis_create_kthread_workers(&i2c_dev->base_dev); if (ret) { - dev_err(i2c_dev->base_dev.dev,"Failed to create lwis_i2c_kthread"); + dev_err(i2c_dev->base_dev.dev, "Failed to create lwis_i2c_kthread"); lwis_base_unprobe(&i2c_dev->base_dev); goto error_probe; } if (i2c_dev->base_dev.transaction_thread_priority != 0) { ret = lwis_set_kthread_priority(&i2c_dev->base_dev, - i2c_dev->base_dev.transaction_worker_thread, - i2c_dev->base_dev.transaction_thread_priority); + i2c_dev->base_dev.transaction_worker_thread, + i2c_dev->base_dev.transaction_thread_priority); if (ret) { dev_err(i2c_dev->base_dev.dev, - "Failed to set LWIS I2C transaction kthread priority (%d)", - ret); + "Failed to set LWIS I2C transaction kthread priority (%d)", ret); lwis_base_unprobe(&i2c_dev->base_dev); goto error_probe; } diff --git a/lwis_device_i2c.h b/lwis_device_i2c.h index 1ae8294..7d52d1f 100644 --- a/lwis_device_i2c.h +++ b/lwis_device_i2c.h @@ -43,8 +43,7 @@ int lwis_i2c_device_deinit(void); * two APIs in stmvl53l1 driver to well handle the enabling and disabling. */ extern bool is_shared_i2c_with_stmvl53l1(struct pinctrl *pinctrl); -extern int shared_i2c_set_state(struct device *dev, struct pinctrl *pinctrl, - const char *state_str); +extern int shared_i2c_set_state(struct device *dev, struct pinctrl *pinctrl, const char *state_str); #endif #endif /* LWIS_DEVICE_I2C_H_ */ diff --git a/lwis_device_ioreg.c b/lwis_device_ioreg.c index ed98410..36d2d98 100644 --- a/lwis_device_ioreg.c +++ b/lwis_device_ioreg.c @@ -138,12 +138,11 @@ static int lwis_ioreg_device_probe(struct platform_device *plat_dev) if (ioreg_dev->base_dev.transaction_thread_priority != 0) { ret = lwis_set_kthread_priority(&ioreg_dev->base_dev, - ioreg_dev->base_dev.transaction_worker_thread, - ioreg_dev->base_dev.transaction_thread_priority); + ioreg_dev->base_dev.transaction_worker_thread, + ioreg_dev->base_dev.transaction_thread_priority); if (ret) { dev_err(ioreg_dev->base_dev.dev, - "Failed to set LWIS IOREG transaction kthread priority (%d)", - ret); + "Failed to set LWIS IOREG transaction kthread priority (%d)", ret); lwis_base_unprobe(&ioreg_dev->base_dev); goto error_probe; } diff --git a/lwis_device_top.c b/lwis_device_top.c index ea4085e..c1966b4 100644 --- a/lwis_device_top.c +++ b/lwis_device_top.c @@ -512,20 +512,18 @@ static int lwis_top_device_probe(struct platform_device *plat_dev) lwis_top_event_subscribe_init(top_dev); kthread_init_worker(&top_dev->subscribe_worker); - top_dev->subscribe_worker_thread = kthread_run(kthread_worker_fn, - &top_dev->subscribe_worker, LWIS_SUBSCRIBER_THREAD_NAME); + top_dev->subscribe_worker_thread = kthread_run( + kthread_worker_fn, &top_dev->subscribe_worker, LWIS_SUBSCRIBER_THREAD_NAME); if (IS_ERR(top_dev->subscribe_worker_thread)) { dev_err(top_dev->base_dev.dev, "subscribe kthread_run failed\n"); goto error_probe; } - ret = lwis_set_kthread_priority(&top_dev->base_dev, - top_dev->subscribe_worker_thread, - SUBSCRIBE_THREAD_PRIORITY); + ret = lwis_set_kthread_priority(&top_dev->base_dev, top_dev->subscribe_worker_thread, + SUBSCRIBE_THREAD_PRIORITY); if (ret) { dev_err(top_dev->base_dev.dev, - "Failed to set LWIS top subscription kthread priority (%d)", - ret); + "Failed to set LWIS top subscription kthread priority (%d)", ret); lwis_base_unprobe(&top_dev->base_dev); goto error_probe; } diff --git a/lwis_device_top.h b/lwis_device_top.h index e2ef4ea..8d0a324 100644 --- a/lwis_device_top.h +++ b/lwis_device_top.h @@ -32,7 +32,6 @@ struct lwis_top_device { struct kthread_work subscribe_work; struct list_head emitted_event_list_work; - /* Subscription thread */ struct kthread_worker subscribe_worker; struct task_struct *subscribe_worker_thread; @@ -141,8 +141,8 @@ static int parse_irq_gpios(struct lwis_device *lwis_dev) goto error_parse_irq_gpios; } - type_count = of_property_read_variable_u32_array( - dev_node, "irq-gpios-types", irq_gpios_types, type_count, type_count); + type_count = of_property_read_variable_u32_array(dev_node, "irq-gpios-types", + irq_gpios_types, type_count, type_count); if (type_count != count) { pr_err("Error getting irq-gpios-types: %d\n", type_count); diff --git a/lwis_event.c b/lwis_event.c index baccbd9..971d70a 100644 --- a/lwis_event.c +++ b/lwis_event.c @@ -24,13 +24,13 @@ /* Exposes the device id embedded in the event id */ #define EVENT_OWNER_DEVICE_ID(x) ((x >> LWIS_EVENT_ID_EVENT_CODE_LEN) & 0xFFFF) -#define lwis_dev_err_ratelimited(dev, fmt, ...) \ - { \ - static int64_t timestamp = 0; \ - if (ktime_to_ns(lwis_get_time()) - timestamp > 200000000LL) { \ - dev_err(dev, fmt, ##__VA_ARGS__); \ - timestamp = ktime_to_ns(lwis_get_time()); \ - } \ +#define lwis_dev_err_ratelimited(dev, fmt, ...) \ + { \ + static int64_t timestamp = 0; \ + if (ktime_to_ns(lwis_get_time()) - timestamp > 200000000LL) { \ + dev_err(dev, fmt, ##__VA_ARGS__); \ + timestamp = ktime_to_ns(lwis_get_time()); \ + } \ } /* @@ -989,15 +989,15 @@ int lwis_pending_events_emit(struct lwis_device *lwis_dev, struct list_head *pen while (!list_empty(pending_events)) { event = list_first_entry(pending_events, struct lwis_event_entry, node); - emit_result = lwis_device_event_emit_impl(lwis_dev, event->event_info.event_id, - event->event_info.payload_buffer, - event->event_info.payload_size, - pending_events); + emit_result = + lwis_device_event_emit_impl(lwis_dev, event->event_info.event_id, + event->event_info.payload_buffer, + event->event_info.payload_size, pending_events); if (emit_result) { return_val = emit_result; dev_warn_ratelimited(lwis_dev->dev, - "lwis_device_pending_event_emit error on ID 0x%llx\n", - event->event_info.event_id); + "lwis_device_pending_event_emit error on ID 0x%llx\n", + event->event_info.event_id); } list_del(&event->node); kfree(event); diff --git a/lwis_fence.h b/lwis_fence.h index 71b17e5..4aa0aac 100644 --- a/lwis_fence.h +++ b/lwis_fence.h @@ -70,16 +70,13 @@ bool lwis_event_triggered_condition_ready(struct lwis_transaction *transaction, struct lwis_transaction *weak_transaction, int64_t event_id, int64_t event_counter); - -bool lwis_fence_triggered_condition_ready(struct lwis_transaction *transaction, - int fence_status); +bool lwis_fence_triggered_condition_ready(struct lwis_transaction *transaction, int fence_status); /* * lwis_parse_trigger_condition: Add the transaction to the associated trigger * fence and event lists. */ -int lwis_parse_trigger_condition(struct lwis_client *client, - struct lwis_transaction *transaction); +int lwis_parse_trigger_condition(struct lwis_client *client, struct lwis_transaction *transaction); /* * lwis_fence_signal: Signals the lwis_fence with the provided error code. @@ -115,30 +112,26 @@ static inline int lwis_initialize_transaction_fences(struct lwis_client *client, return 0; } -static inline -bool lwis_triggered_by_condition(struct lwis_transaction *transaction) +static inline bool lwis_triggered_by_condition(struct lwis_transaction *transaction) { return false; } -static inline -bool lwis_event_triggered_condition_ready(struct lwis_transaction *transaction, - struct lwis_transaction *weak_transaction, - int64_t event_id, int64_t event_counter) +static inline bool lwis_event_triggered_condition_ready(struct lwis_transaction *transaction, + struct lwis_transaction *weak_transaction, + int64_t event_id, int64_t event_counter) { return false; } -static inline -bool lwis_fence_triggered_condition_ready(struct lwis_transaction *transaction, - int fence_status) +static inline bool lwis_fence_triggered_condition_ready(struct lwis_transaction *transaction, + int fence_status) { return false; } -static inline -int lwis_parse_trigger_condition(struct lwis_client *client, struct - lwis_transaction *transaction) +static inline int lwis_parse_trigger_condition(struct lwis_client *client, + struct lwis_transaction *transaction) { return 0; } diff --git a/lwis_ioctl.c b/lwis_ioctl.c index debeb4d..b284844 100644 --- a/lwis_ioctl.c +++ b/lwis_ioctl.c @@ -1436,11 +1436,13 @@ static int cmd_dpm_qos_update(struct lwis_device *lwis_dev, struct lwis_cmd_pkt for (i = 0; i < k_msg.reqs.num_settings; i++) { if (sizeof(struct lwis_qos_setting) != sizeof(struct lwis_qos_setting_v2)) { struct lwis_qos_setting_v2 k_qos_setting_v2; - memcpy(&k_qos_setting_v2, &k_qos_settings[i], sizeof(struct lwis_qos_setting)); + memcpy(&k_qos_setting_v2, &k_qos_settings[i], + sizeof(struct lwis_qos_setting)); k_qos_setting_v2.bts_block_name[0] = '\0'; ret = lwis_dpm_update_qos(lwis_dev, &k_qos_setting_v2); } else { - ret = lwis_dpm_update_qos(lwis_dev, (struct lwis_qos_setting_v2 *)&k_qos_settings[i]); + ret = lwis_dpm_update_qos(lwis_dev, + (struct lwis_qos_setting_v2 *)&k_qos_settings[i]); } if (ret) { dev_err(lwis_dev->dev, "Failed to apply qos setting, ret: %d\n", ret); @@ -1455,7 +1457,7 @@ exit: } static int cmd_dpm_qos_update_v2(struct lwis_device *lwis_dev, struct lwis_cmd_pkt *header, - struct lwis_cmd_dpm_qos_update_v2 __user *u_msg) + struct lwis_cmd_dpm_qos_update_v2 __user *u_msg) { struct lwis_cmd_dpm_qos_update_v2 k_msg; struct lwis_qos_setting_v2 *k_qos_settings; diff --git a/lwis_ioreg.c b/lwis_ioreg.c index 90870aa..ce8ee75 100644 --- a/lwis_ioreg.c +++ b/lwis_ioreg.c @@ -271,28 +271,28 @@ static int ioreg_write_batch_internal(void __iomem *base, uint64_t offset, int v case 8: for (i = 0; i < size_in_bytes; ++i) { writeb_relaxed(*(buf + i), is_offset_fixed ? (void __iomem *)(addr) : - (void __iomem *)(addr + i)); + (void __iomem *)(addr + i)); } break; case 16: for (i = 0; i < size_in_bytes; i += 2) { writew_relaxed(*(uint16_t *)(buf + i), is_offset_fixed ? (void __iomem *)(addr) : - (void __iomem *)(addr + i)); + (void __iomem *)(addr + i)); } break; case 32: for (i = 0; i < size_in_bytes; i += 4) { writel_relaxed(*(uint32_t *)(buf + i), is_offset_fixed ? (void __iomem *)(addr) : - (void __iomem *)(addr + i)); + (void __iomem *)(addr + i)); } break; case 64: for (i = 0; i < size_in_bytes; i += 8) { writeq_relaxed(*(uint64_t *)(buf + i), is_offset_fixed ? (void __iomem *)(addr) : - (void __iomem *)(addr + i)); + (void __iomem *)(addr + i)); } break; default: diff --git a/lwis_periodic_io.c b/lwis_periodic_io.c index d12fde8..06f855b 100644 --- a/lwis_periodic_io.c +++ b/lwis_periodic_io.c @@ -188,8 +188,7 @@ static int process_io_entries(struct lwis_client *client, /* Abort if periodic io is deactivated during processing. * Abort can only apply to <= 1 write entries to prevent partial writes, * or we just started the process. */ - if (!periodic_io->active && - (i == 0 || !periodic_io->contains_multiple_writes)) { + if (!periodic_io->active && (i == 0 || !periodic_io->contains_multiple_writes)) { resp->error_code = -ECANCELED; goto event_push; } @@ -317,7 +316,7 @@ void lwis_process_periodic_io_in_queue(struct lwis_client *client) /* Error indicates the cancellation of the periodic io */ if (periodic_io->resp->error_code || !periodic_io->active) { error_code = periodic_io->resp->error_code ? periodic_io->resp->error_code : - -ECANCELED; + -ECANCELED; push_periodic_io_error_event_locked(periodic_io, error_code, &pending_events); } else { @@ -558,7 +557,8 @@ static int mark_periodic_io_resp_error_locked(struct lwis_periodic_io *periodic_ } /* Calling this function requires holding the client's periodic_io_lock */ -static struct lwis_periodic_io * periodic_io_find_locked(struct lwis_client *client, int64_t id) { +static struct lwis_periodic_io *periodic_io_find_locked(struct lwis_client *client, int64_t id) +{ int i; struct hlist_node *tmp; struct list_head *it_period, *it_period_tmp; diff --git a/lwis_trace.h b/lwis_trace.h index 04c8540..e1f14a6 100644 --- a/lwis_trace.h +++ b/lwis_trace.h @@ -19,9 +19,8 @@ #include "lwis_commands.h" #include "lwis_device.h" -#define LWIS_DEVICE_NAME_ENTRY \ - __array(char, lwis_name, LWIS_MAX_NAME_STRING_LEN) -#define LWIS_DEVICE_NAME_ASSIGN \ +#define LWIS_DEVICE_NAME_ENTRY __array(char, lwis_name, LWIS_MAX_NAME_STRING_LEN) +#define LWIS_DEVICE_NAME_ASSIGN \ strscpy(__entry->lwis_name, lwis_dev->name, LWIS_MAX_NAME_STRING_LEN) #define LWIS_TRACE_DEVICE_NAME __entry->lwis_name @@ -36,17 +35,17 @@ TRACE_EVENT(tracing_mark_write, TP_printk("%c|%d|lwis-%s:%s|%lld", __entry->type, __entry->pid, LWIS_TRACE_DEVICE_NAME, __get_str(func_name), __entry->value)); -#define LWIS_ATRACE_BEGIN(lwis_dev, func_name) \ +#define LWIS_ATRACE_BEGIN(lwis_dev, func_name) \ trace_tracing_mark_write(lwis_dev, 'B', current->tgid, func_name, 0) #define LWIS_ATRACE_FUNC_BEGIN(lwis_dev, func_name) LWIS_ATRACE_BEGIN(lwis_dev, func_name) -#define LWIS_ATRACE_END(lwis_dev, func_name) \ +#define LWIS_ATRACE_END(lwis_dev, func_name) \ trace_tracing_mark_write(lwis_dev, 'E', current->tgid, func_name, 0) #define LWIS_ATRACE_FUNC_END(lwis_dev, func_name) LWIS_ATRACE_END(lwis_dev, func_name) -#define LWIS_ATRACE_INT_PID(lwis_dev, func_name, value, pid) \ +#define LWIS_ATRACE_INT_PID(lwis_dev, func_name, value, pid) \ trace_tracing_mark_write(lwis_dev, 'C', pid, func_name, value) -#define LWIS_ATRACE_INT(lwis_dev, func_name, value) \ +#define LWIS_ATRACE_INT(lwis_dev, func_name, value) \ LWIS_ATRACE_INT_PID(lwis_dev, func_name, value, current->tgid) #endif /* _TRACE_LWIS_H_ */ diff --git a/lwis_util.c b/lwis_util.c index 5a6321e..26e8163 100644 --- a/lwis_util.c +++ b/lwis_util.c @@ -123,8 +123,8 @@ int lwis_create_kthread_workers(struct lwis_device *lwis_dev) scnprintf(t_name, LWIS_MAX_NAME_STRING_LEN, "lwis_t_%s", lwis_dev->name); kthread_init_worker(&lwis_dev->transaction_worker); - lwis_dev->transaction_worker_thread = kthread_run(kthread_worker_fn, - &lwis_dev->transaction_worker, t_name); + lwis_dev->transaction_worker_thread = + kthread_run(kthread_worker_fn, &lwis_dev->transaction_worker, t_name); if (IS_ERR(lwis_dev->transaction_worker_thread)) { dev_err(lwis_dev->dev, "transaction kthread_run failed\n"); return -EINVAL; @@ -133,16 +133,15 @@ int lwis_create_kthread_workers(struct lwis_device *lwis_dev) return 0; } -int lwis_set_kthread_priority(struct lwis_device *lwis_dev, struct task_struct *task, - u32 priority) +int lwis_set_kthread_priority(struct lwis_device *lwis_dev, struct task_struct *task, u32 priority) { int policy; struct sched_param param; int ret; if (priority >= MAX_PRIO) { - dev_err(lwis_dev->dev, "transaction_thread_priority(%d) >= Max(%d)", - priority, MAX_PRIO); + dev_err(lwis_dev->dev, "transaction_thread_priority(%d) >= Max(%d)", priority, + MAX_PRIO); return -EINVAL; } if (priority < MAX_RT_PRIO) { diff --git a/lwis_util.h b/lwis_util.h index 8ce68f4..29dca82 100644 --- a/lwis_util.h +++ b/lwis_util.h @@ -78,7 +78,6 @@ int lwis_create_kthread_workers(struct lwis_device *lwis_dev); /* * lwis_set_kthread_priority: Set kthread priority. */ -int lwis_set_kthread_priority(struct lwis_device *lwis_dev, struct task_struct *task, - u32 priority); +int lwis_set_kthread_priority(struct lwis_device *lwis_dev, struct task_struct *task, u32 priority); #endif // LWIS_UTIL_H_ diff --git a/platform/anchorage/lwis_platform_anchorage_dma.c b/platform/anchorage/lwis_platform_anchorage_dma.c index 401275c..22b4257 100644 --- a/platform/anchorage/lwis_platform_anchorage_dma.c +++ b/platform/anchorage/lwis_platform_anchorage_dma.c @@ -37,8 +37,8 @@ struct dma_buf *lwis_platform_dma_buffer_alloc(size_t len, unsigned int flags) dmabuf = dma_heap_buffer_alloc(heap, len, O_RDWR, 0); if (IS_ERR_OR_NULL(dmabuf)) { - pr_err("DMA-BUF heap failed to alloc %#zx bytes. Error code %lu\n", - len, PTR_ERR(dmabuf)); + pr_err("DMA-BUF heap failed to alloc %#zx bytes. Error code %lu\n", len, + PTR_ERR(dmabuf)); dmabuf = NULL; } |