RE: [PATCH v3] staging: ste_rmi4: Convert to Type-B support
From: Alexandra Chin <hidden>
Date: 2012-11-12 11:59:38
Also in:
lkml
Hi Henrik, Really thanks a lot for all your advice.
quoted
@@ -751,7 +739,7 @@ static int synaptics_rmi4_i2c_query_device(structsynaptics_rmi4_data *pdata)quoted
pdata->fn01_data_base_addr = rmi_fd.data_base_addr; break; - case SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM: + case SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM: if (rmi_fd.intr_src_count) { rfi = kmalloc(sizeof(*rfi), GFP_KERNEL);@@ -761,7 +749,8 @@ static int synaptics_rmi4_i2c_query_device(structsynaptics_rmi4_data *pdata)quoted
__func__); return -ENOMEM; } - retval = synpatics_rmi4_touchpad_detect + retval = + synpatics_rmi4_touchscreen_detect (pdata, rfi, &rmi_fd, intr_count);Odd line break is a clear sign that something could be broken out into its own function.quoted
@@ -854,8 +843,9 @@ static int synaptics_rmi4_i2c_query_device(structsynaptics_rmi4_data *pdata)quoted
list_for_each_entry(rfi, &rmi->support_fn_list, link) { if (rfi->num_of_data_sources) { if (rfi->fn_number == - SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM) { - retval = synaptics_rmi4_touchpad_config + SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM) { + retval = + synaptics_rmi4_touchscreen_config (pdata, rfi); if (retval < 0) return retval;Same here.
As you mentioned, there are odd lines in patch v3. These odd lines are because that lines are over 80 characters after "touchpad" is replaced by "touchscreen". In patch v4, I did the splitting of the functions to fix line over 80 characters issue (and other irrelevant work). Somehow I realized that code itself can be optimized, and there is no need to break out function to fix line over 80 characters issues. Therefore I rollback patch to v3, and reorganized code flow to fix line over 80 characters issues in patch v5. Patch v5 only includes odd lines issue fixed, although it looks a little too large. And these changes have been verified with Pandaboard. Greatly appreciate your suggestions, and please let me know if you have any concerns about v5 (https://lkml.org/lkml/2012/11/8/31). Yours very truly, Alexandra