Skip to content

Commit

Permalink
Fix make check, and then fix checkpatch warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
StollD committed Jan 24, 2023
1 parent e868c45 commit 490269b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Makefile for the IPTS touchscreen driver
#

sources += dkms.conf
sources := Makefile
sources := dkms.conf
sources += Makefile
sources += src/cmd.c
sources += src/cmd.h
sources += src/context.h
Expand All @@ -14,15 +14,19 @@ sources += src/desc.h
sources += src/hid.c
sources += src/hid.h
sources += src/Kconfig
sources := src/Makefile
sources += src/Makefile
sources += src/main.c
sources += src/mei.c
sources += src/mei.h
sources += src/receiver.c
sources += src/receiver.h
sources += src/resources.c
sources += src/resources.h
sources += src/spec-data.h
sources += src/spec-device.h
sources += src/spec-hid.h
sources += src/thread.c
sources += src/thread.h

KVERSION ?= $(shell uname -r)
KDIR := /lib/modules/$(KVERSION)/build
Expand Down
2 changes: 1 addition & 1 deletion src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int ipts_cmd_recv_timeout(struct ipts_context *ipts, enum ipts_command_code code

/*
* In a response, the command code will have the most significant bit flipped to 1.
* If code is passed to ipts_mei_recv as is, no messages will be recevied.
* If code is passed to ipts_mei_recv as is, no messages will be received.
*/
ret = ipts_mei_recv(&ipts->mei, code | IPTS_RSP_BIT, rsp, timeout);
if (ret < 0)
Expand Down
6 changes: 3 additions & 3 deletions src/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* A negative timeout means to wait forever.
*
* Returns: 0 on success, <0 on error, -EAGAIN if no response has been received.
*/
*/
int ipts_cmd_recv_timeout(struct ipts_context *ipts, enum ipts_command_code code,
struct ipts_response *rsp, u64 timeout);

Expand All @@ -40,7 +40,7 @@ int ipts_cmd_recv_timeout(struct ipts_context *ipts, enum ipts_command_code code
* @rsp: The address that the received response will be copied to.
*
* Returns: 0 on success, <0 on error, -EAGAIN if no response has been received.
*/
*/
static inline int ipts_cmd_recv(struct ipts_context *ipts, enum ipts_command_code code,
struct ipts_response *rsp)
{
Expand All @@ -55,7 +55,7 @@ static inline int ipts_cmd_recv(struct ipts_context *ipts, enum ipts_command_cod
* @size: The size of the payload.
*
* Returns: 0 on success, <0 on error.
*/
*/
int ipts_cmd_send(struct ipts_context *ipts, enum ipts_command_code code, void *data, size_t size);

#endif /* IPTS_CMD_H */
3 changes: 3 additions & 0 deletions src/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ struct ipts_context {

enum ipts_mode mode;

/*
* Prevents concurrent GET_FEATURE reports.
*/
struct mutex feature_lock;
struct completion feature_event;

Expand Down
2 changes: 1 addition & 1 deletion src/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ int ipts_control_wait_data(struct ipts_context *ipts, bool shutdown)

/*
* During shutdown, it is possible that the sensor has already been disabled.
*/
*/
if (rsp.status == IPTS_STATUS_SENSOR_DISABLED)
return 0;

Expand Down
14 changes: 7 additions & 7 deletions src/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
* All outstanding data needs to be acknowledged using feedback before the command will return.
*
* Returns: 0 on success, <0 on error.
*/
*/
int ipts_control_request_flush(struct ipts_context *ipts);

/*
* ipts_control_wait_flush() - Wait until data flow has been stopped.
* @ipts: The IPTS driver context.
*
* Returns: 0 on success, <0 on error.
*/
*/
int ipts_control_wait_flush(struct ipts_context *ipts);

/*
* ipts_control_wait_flush() - Notify the device that the driver can receive new data.
* @ipts: The IPTS driver context.
*
* Returns: 0 on success, <0 on error.
*/
*/
int ipts_control_request_data(struct ipts_context *ipts);

/*
Expand All @@ -51,7 +51,7 @@ int ipts_control_request_data(struct ipts_context *ipts);
* the doorbell will be incremented when new data is available.
*
* Returns: 0 on success, <0 on error, -EAGAIN if no data is available.
*/
*/
int ipts_control_wait_data(struct ipts_context *ipts, bool block);

/*
Expand All @@ -60,7 +60,7 @@ int ipts_control_wait_data(struct ipts_context *ipts, bool block);
* @buffer: The ID of the buffer containing feedback data.
*
* Returns: 0 on success, <0 on error.
*/
*/
int ipts_control_send_feedback(struct ipts_context *ipts, u32 buffer);

/*
Expand Down Expand Up @@ -90,8 +90,8 @@ int ipts_control_hid2me_feedback(struct ipts_context *ipts, enum ipts_feedback_c
static inline int ipts_control_refill_buffer(struct ipts_context *ipts, u32 buffer)
{
/*
* IPTS expects structured data in the feedback buffer matching the buffer that will be refilled.
* We don't know what that data looks like, so we just keep the buffer empty.
* IPTS expects structured data in the feedback buffer matching the buffer that will be
+ refilled. We don't know what that data looks like, so we just keep the buffer empty.
* This results in an INVALID_PARAMS error, but the buffer gets refilled without an issue.
* Sending a minimal structure with the buffer ID fixes the error, but breaks refilling
* the buffers on some devices.
Expand Down
4 changes: 2 additions & 2 deletions src/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include <linux/sched.h>

/*
* This wrapper over kthread is neccessary, because calling kthread_stop makes it impossible
* This wrapper over kthread is necessary, because calling kthread_stop makes it impossible
* to issue MEI commands from that thread while it shuts itself down. By using a custom
* boolean variable and a completion object, we can call kthread_stop only when the thread
* already finished all of its work and has returned.
*/
*/
struct ipts_thread {
struct task_struct *thread;

Expand Down

0 comments on commit 490269b

Please sign in to comment.