[PATCH 08/10] Input: synaptics-rmi4 - F54 style and typo fixes
From: Dmitry Torokhov
Date: Fri Jun 26 2026 - 01:20:32 EST
Clean up style issues in rmi_f54.c reported by checkpatch.pl --strict:
- Convert (1 << X) caps to BIT(X).
- Align assignment operator '=' in report_types array.
- Add comments to status_mutex, data_mutex, and lock explaining what they protect.
- Align function arguments/parameters with open parenthesis in rmi_f54_get_reptype() and rmi_f54_vidioc_querycap().
- Fix typo 'firmare' -> 'firmware' in comment.
- Align dev_err() argument with open parenthesis in rmi_f54_work().
- Use '!ptr' instead of 'ptr == NULL' for report_data check in rmi_f54_probe().
Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/input/rmi4/rmi_f54.c | 38 ++++++++++++++++++------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c
index 93526feea563..850e1742c480 100644
--- a/drivers/input/rmi4/rmi_f54.c
+++ b/drivers/input/rmi4/rmi_f54.c
@@ -5,6 +5,7 @@
*/
#include <linux/kernel.h>
+#include <linux/bits.h>
#include <linux/rmi.h>
#include <linux/input.h>
#include <linux/slab.h>
@@ -35,9 +36,9 @@
#define F54_FORCE_CAL 2
/* F54 capabilities */
-#define F54_CAP_BASELINE (1 << 2)
-#define F54_CAP_IMAGE8 (1 << 3)
-#define F54_CAP_IMAGE16 (1 << 6)
+#define F54_CAP_BASELINE BIT(2)
+#define F54_CAP_IMAGE8 BIT(3)
+#define F54_CAP_IMAGE16 BIT(6)
/**
* enum rmi_f54_report_type - RMI4 F54 report types
@@ -83,14 +84,13 @@ enum rmi_f54_report_type {
};
static const char * const rmi_f54_report_type_names[] = {
- [F54_REPORT_NONE] = "Unknown",
- [F54_8BIT_IMAGE] = "Normalized 8-Bit Image",
- [F54_16BIT_IMAGE] = "Normalized 16-Bit Image",
- [F54_RAW_16BIT_IMAGE] = "Raw 16-Bit Image",
- [F54_TRUE_BASELINE] = "True Baseline",
- [F54_FULL_RAW_CAP] = "Full Raw Capacitance",
- [F54_FULL_RAW_CAP_RX_OFFSET_REMOVED]
- = "Full Raw Capacitance RX Offset Removed",
+ [F54_REPORT_NONE] = "Unknown",
+ [F54_8BIT_IMAGE] = "Normalized 8-Bit Image",
+ [F54_16BIT_IMAGE] = "Normalized 16-Bit Image",
+ [F54_RAW_16BIT_IMAGE] = "Raw 16-Bit Image",
+ [F54_TRUE_BASELINE] = "True Baseline",
+ [F54_FULL_RAW_CAP] = "Full Raw Capacitance",
+ [F54_FULL_RAW_CAP_RX_OFFSET_REMOVED] = "Full Raw Capacitance RX Offset Removed",
};
struct f54_data {
@@ -109,8 +109,8 @@ struct f54_data {
int report_error;
bool is_busy;
- struct mutex status_mutex;
- struct mutex data_mutex;
+ struct mutex status_mutex; /* Protects is_busy and command state */
+ struct mutex data_mutex; /* Protects report_data buffer */
struct workqueue_struct *workqueue;
struct delayed_work work;
@@ -123,7 +123,7 @@ struct f54_data {
struct v4l2_pix_format format;
struct video_device vdev;
struct vb2_queue queue;
- struct mutex lock;
+ struct mutex lock; /* Serializes V4L2 device and queue access */
u32 sequence;
int input;
enum rmi_f54_report_type inputs[F54_MAX_REPORT_TYPE];
@@ -153,7 +153,7 @@ static bool is_f54_report_type_valid(struct f54_data *f54,
}
static enum rmi_f54_report_type rmi_f54_get_reptype(struct f54_data *f54,
- unsigned int i)
+ unsigned int i)
{
if (i >= F54_MAX_REPORT_TYPE)
return F54_REPORT_NONE;
@@ -193,7 +193,7 @@ static int rmi_f54_request_report(struct rmi_function *fn, u8 report_type)
/*
* Small delay after disabling interrupts to avoid race condition
- * in firmare. This value is a bit higher than absolutely necessary.
+ * in firmware. This value is a bit higher than absolutely necessary.
* Should be removed once issue is resolved in firmware.
*/
usleep_range(2000, 3000);
@@ -406,7 +406,7 @@ static int rmi_f54_vidioc_querycap(struct file *file, void *priv,
strscpy(cap->driver, F54_NAME, sizeof(cap->driver));
strscpy(cap->card, SYNAPTICS_INPUT_DEVICE_NAME, sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info),
- "rmi4:%s", dev_name(&f54->fn->dev));
+ "rmi4:%s", dev_name(&f54->fn->dev));
return 0;
}
@@ -563,7 +563,7 @@ static void rmi_f54_work(struct work_struct *work)
report_size = rmi_f54_get_report_size(f54);
if (report_size == 0) {
dev_err(&fn->dev, "Bad report size, report type=%d\n",
- f54->report_type);
+ f54->report_type);
error = -EINVAL;
goto out; /* retry won't help */
}
@@ -709,7 +709,7 @@ static int rmi_f54_probe(struct rmi_function *fn)
f54->max_report_size = array3_size(tx, rx, sizeof(u16));
f54->report_data = devm_kzalloc(&fn->dev, f54->max_report_size,
GFP_KERNEL);
- if (f54->report_data == NULL)
+ if (!f54->report_data)
return -ENOMEM;
INIT_DELAYED_WORK(&f54->work, rmi_f54_work);
--
2.55.0.rc0.799.gd6f94ed593-goog