Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

HID: bpf: doc fixes for hid_hw_request() hooks

We had the following errors while doing make htmldocs:

Documentation/hid/hid-bpf:185: include/linux/hid_bpf.h:167:
ERROR: Unexpected indentation.

Also ensure consistency with the rest of the __u64 vs u64.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 9286675a2aed ("HID: bpf: add HID-BPF hooks for hid_hw_output_report")
Link: https://patch.msgid.link/20240701-fix-cki-v2-4-20564e2e1393@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

+9 -7
+1 -1
drivers/hid/bpf/hid_bpf_dispatch.c
··· 115 115 EXPORT_SYMBOL_GPL(dispatch_hid_bpf_raw_requests); 116 116 117 117 int dispatch_hid_bpf_output_report(struct hid_device *hdev, 118 - __u8 *buf, u32 size, __u64 source, 118 + __u8 *buf, u32 size, u64 source, 119 119 bool from_bpf) 120 120 { 121 121 struct hid_bpf_ctx_kern ctx_kern = {
+8 -6
include/linux/hid_bpf.h
··· 138 138 * It has the following arguments: 139 139 * 140 140 * ``ctx``: The HID-BPF context as &struct hid_bpf_ctx 141 + * 141 142 * ``reportnum``: the report number, as in hid_hw_raw_request() 142 143 * 143 144 * ``rtype``: the report type (``HID_INPUT_REPORT``, ``HID_FEATURE_REPORT``, ··· 166 165 * It has the following arguments: 167 166 * 168 167 * ``ctx``: The HID-BPF context as &struct hid_bpf_ctx 168 + * 169 169 * ``source``: a u64 referring to a uniq but identifiable source. If %0, the 170 - * kernel itself emitted that call. For hidraw, ``source`` is set 171 - * to the associated ``struct file *``. 170 + * kernel itself emitted that call. For hidraw, ``source`` is set 171 + * to the associated ``struct file *``. 172 172 * 173 173 * Return: %0 to keep processing the request by hid-core; any other value 174 174 * stops hid-core from processing that event. A positive value should be 175 175 * returned with the number of bytes written to the device; a negative error 176 176 * code interrupts the processing of this call. 177 177 */ 178 - int (*hid_hw_output_report)(struct hid_bpf_ctx *ctx, __u64 source); 178 + int (*hid_hw_output_report)(struct hid_bpf_ctx *ctx, u64 source); 179 179 180 180 181 181 /* private: do not show up in the docs */ ··· 205 203 unsigned char reportnum, __u8 *buf, 206 204 u32 size, enum hid_report_type rtype, 207 205 enum hid_class_request reqtype, 208 - __u64 source, bool from_bpf); 206 + u64 source, bool from_bpf); 209 207 int dispatch_hid_bpf_output_report(struct hid_device *hdev, __u8 *buf, u32 size, 210 - __u64 source, bool from_bpf); 208 + u64 source, bool from_bpf); 211 209 int hid_bpf_connect_device(struct hid_device *hdev); 212 210 void hid_bpf_disconnect_device(struct hid_device *hdev); 213 211 void hid_bpf_destroy_device(struct hid_device *hid); ··· 223 221 enum hid_class_request reqtype, 224 222 u64 source, bool from_bpf) { return 0; } 225 223 static inline int dispatch_hid_bpf_output_report(struct hid_device *hdev, __u8 *buf, u32 size, 226 - __u64 source, bool from_bpf) { return 0; } 224 + u64 source, bool from_bpf) { return 0; } 227 225 static inline int hid_bpf_connect_device(struct hid_device *hdev) { return 0; } 228 226 static inline void hid_bpf_disconnect_device(struct hid_device *hdev) {} 229 227 static inline void hid_bpf_destroy_device(struct hid_device *hid) {}