Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1234400 > unrolled thread
| Started by | Brent Adam <brentadamdev@gmail.com> |
|---|---|
| First post | 2015-09-28 22:10 +0200 |
| Last post | 2015-09-30 10:00 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] HID: hid-multitouch.c: fix formatting warnings Brent Adam <brentadamdev@gmail.com> - 2015-09-28 22:10 +0200
Re: [PATCH] HID: hid-multitouch.c: fix formatting warnings Jiri Kosina <jikos@kernel.org> - 2015-09-29 15:00 +0200
Re: [PATCH] HID: hid-multitouch.c: fix formatting warnings Brent Adam <BrentAdam@smarttech.com> - 2015-09-29 16:20 +0200
Re: [PATCH] HID: hid-multitouch.c: fix formatting warnings Jiri Kosina <jikos@kernel.org> - 2015-09-30 10:00 +0200
| From | Brent Adam <brentadamdev@gmail.com> |
|---|---|
| Date | 2015-09-28 22:10 +0200 |
| Subject | [PATCH] HID: hid-multitouch.c: fix formatting warnings |
| Message-ID | <qdMUh-1fb-5@gated-at.bofh.it> |
Fixed the following checkpatch.pl warnings:
WARNING: line over 80 characters: line 163
WARNING: Missing a blank line after declarations: line 359
WARNING: Missing a blank line after declarations: line 572
WARNING: Missing a blank line after declarations: line 708
WARNING: Missing a blank line after declarations: line 926
WARNING: Possible unnecessary 'out of memory' message: line 1034
WARNING: Possible unnecessary 'out of memory' message: line 1048
WARNING: line over 80 characters: line 1390
Signed-off-by: Brent Adam <brentadam@smarttech.com>
---
drivers/hid/hid-multitouch.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 426b2f1..662296e 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -160,7 +160,8 @@ static void mt_post_parse(struct mt_device *td);
#define MT_MAX_MAXCONTACT 250
#define MT_USB_DEVICE(v, p) HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH, v, p)
-#define MT_BT_DEVICE(v, p) HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_MULTITOUCH, v, p)
+#define MT_BT_DEVICE(v, p) HID_DEVICE(BUS_BLUETOOTH, \
+ HID_GROUP_MULTITOUCH, v, p)
/*
* these device-dependent functions determine what slot corresponds
@@ -356,6 +357,7 @@ static void set_abs(struct input_dev *input, unsigned int code,
int fmin = field->logical_minimum;
int fmax = field->logical_maximum;
int fuzz = snratio ? (fmax - fmin) / snratio : 0;
+
input_set_abs_params(input, code, fmin, fmax, fuzz, 0);
input_abs_set_res(input, code, hidinput_calc_abs_res(field, code));
}
@@ -569,6 +571,7 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input)
if ((td->mtclass.quirks & MT_QUIRK_IGNORE_DUPLICATES) && mt) {
struct input_mt_slot *slot = &mt->slots[slotnum];
+
if (input_mt_is_active(slot) &&
input_mt_is_used(mt, slot))
return;
@@ -705,6 +708,7 @@ static void mt_touch_report(struct hid_device *hid, struct hid_report *report)
if (td->cc_index >= 0) {
struct hid_field *field = report->field[td->cc_index];
int value = field->value[td->cc_value_index];
+
if (value)
td->num_expected = value;
}
@@ -923,6 +927,7 @@ static void mt_post_parse(struct mt_device *td)
if (td->touches_by_report > 0) {
int field_count_per_touch = f->length / td->touches_by_report;
+
td->last_slot_field = f->usages[field_count_per_touch - 1];
}
@@ -1030,10 +1035,9 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
hdev->quirks |= HID_QUIRK_NO_INIT_INPUT_REPORTS;
td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL);
- if (!td) {
- dev_err(&hdev->dev, "cannot allocate multitouch data\n");
+ if (!td)
return -ENOMEM;
- }
+
td->mtclass = *mtclass;
td->inputmode = -1;
td->maxcontact_report_id = -1;
@@ -1044,10 +1048,8 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
td->fields = devm_kzalloc(&hdev->dev, sizeof(struct mt_fields),
GFP_KERNEL);
- if (!td->fields) {
- dev_err(&hdev->dev, "cannot allocate multitouch fields data\n");
+ if (!td->fields)
return -ENOMEM;
- }
if (id->vendor == HID_ANY_ID && id->product == HID_ANY_ID)
td->serial_maybe = true;
@@ -1387,7 +1389,8 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_XIROKU_CSR2) },
/* Generic MT device */
- { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) },
+ { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID,
+ HID_ANY_ID) },
/* Generic Win 8 certified MT device */
{ .driver_data = MT_CLS_WIN_8,
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Jiri Kosina <jikos@kernel.org> |
|---|---|
| Date | 2015-09-29 15:00 +0200 |
| Message-ID | <qe2FJ-6Wy-13@gated-at.bofh.it> |
| In reply to | #1234400 |
On Mon, 28 Sep 2015, Brent Adam wrote: > Fixed the following checkpatch.pl warnings: > WARNING: line over 80 characters: line 163 > WARNING: Missing a blank line after declarations: line 359 > WARNING: Missing a blank line after declarations: line 572 > WARNING: Missing a blank line after declarations: line 708 > WARNING: Missing a blank line after declarations: line 926 > WARNING: Possible unnecessary 'out of memory' message: line 1034 > WARNING: Possible unnecessary 'out of memory' message: line 1048 > WARNING: line over 80 characters: line 1390 For files which are already in tree I'd be taking such fixes only as a side-change if refactoring the code anyway in a substantial way. Otherwise I consider the ones below too minor to justify cluttering of git blame. Thanks, -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Brent Adam <BrentAdam@smarttech.com> |
|---|---|
| Date | 2015-09-29 16:20 +0200 |
| Message-ID | <qe3V8-rR-7@gated-at.bofh.it> |
| In reply to | #1235035 |
DQoNCk9uIDkvMjkvMTUsIDY6NTkgQU0sICJKaXJpIEtvc2luYSIgPGppa29zQGtlcm5lbC5vcmc+ IHdyb3RlOg0KDQo+T24gTW9uLCAyOCBTZXAgMjAxNSwgQnJlbnQgQWRhbSB3cm90ZToNCj4NCj4+ IEZpeGVkIHRoZSBmb2xsb3dpbmcgY2hlY2twYXRjaC5wbCB3YXJuaW5nczoNCj4+IFdBUk5JTkc6 IGxpbmUgb3ZlciA4MCBjaGFyYWN0ZXJzOiBsaW5lIDE2Mw0KPj4gV0FSTklORzogTWlzc2luZyBh IGJsYW5rIGxpbmUgYWZ0ZXIgZGVjbGFyYXRpb25zOiBsaW5lIDM1OQ0KPj4gV0FSTklORzogTWlz c2luZyBhIGJsYW5rIGxpbmUgYWZ0ZXIgZGVjbGFyYXRpb25zOiBsaW5lIDU3Mg0KPj4gV0FSTklO RzogTWlzc2luZyBhIGJsYW5rIGxpbmUgYWZ0ZXIgZGVjbGFyYXRpb25zOiBsaW5lIDcwOA0KPj4g V0FSTklORzogTWlzc2luZyBhIGJsYW5rIGxpbmUgYWZ0ZXIgZGVjbGFyYXRpb25zOiBsaW5lIDky Ng0KPj4gV0FSTklORzogUG9zc2libGUgdW5uZWNlc3NhcnkgJ291dCBvZiBtZW1vcnknIG1lc3Nh Z2U6IGxpbmUgMTAzNA0KPj4gV0FSTklORzogUG9zc2libGUgdW5uZWNlc3NhcnkgJ291dCBvZiBt ZW1vcnknIG1lc3NhZ2U6IGxpbmUgMTA0OA0KPj4gV0FSTklORzogbGluZSBvdmVyIDgwIGNoYXJh Y3RlcnM6IGxpbmUgMTM5MA0KPg0KPkZvciBmaWxlcyB3aGljaCBhcmUgYWxyZWFkeSBpbiB0cmVl IEknZCBiZSB0YWtpbmcgc3VjaCBmaXhlcyBvbmx5IGFzIGEgDQo+c2lkZS1jaGFuZ2UgaWYgcmVm YWN0b3JpbmcgdGhlIGNvZGUgYW55d2F5IGluIGEgc3Vic3RhbnRpYWwgd2F5LiBPdGhlcndpc2Ug DQo+SSBjb25zaWRlciB0aGUgb25lcyBiZWxvdyB0b28gbWlub3IgdG8ganVzdGlmeSBjbHV0dGVy aW5nIG9mIGdpdCBibGFtZS4NCg0KDQpPaywgYWx0aG91Z2ggR3JlZyBLcm9haC1IYXJ0bWFuIGlu c3BpcmVzIHlvdSBpbiBoaXMgdmlkZW8gdG8gc3VibWl0IHBhdGNoZXMNCnRvIG1ha2UgdGhlIGNv ZGUgY2hlY2twYXRjaCBjbGVhbi4gaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1MTEJy QkJJbUp0NA0KDQotQnJlbnQNCg== -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jiri Kosina <jikos@kernel.org> |
|---|---|
| Date | 2015-09-30 10:00 +0200 |
| Message-ID | <qeksW-76X-3@gated-at.bofh.it> |
| In reply to | #1235142 |
On Tue, 29 Sep 2015, Brent Adam wrote: > >> Fixed the following checkpatch.pl warnings: > >> WARNING: line over 80 characters: line 163 > >> WARNING: Missing a blank line after declarations: line 359 > >> WARNING: Missing a blank line after declarations: line 572 > >> WARNING: Missing a blank line after declarations: line 708 > >> WARNING: Missing a blank line after declarations: line 926 > >> WARNING: Possible unnecessary 'out of memory' message: line 1034 > >> WARNING: Possible unnecessary 'out of memory' message: line 1048 > >> WARNING: line over 80 characters: line 1390 > > > >For files which are already in tree I'd be taking such fixes only as a > >side-change if refactoring the code anyway in a substantial way. Otherwise > >I consider the ones below too minor to justify cluttering of git blame. > > Ok, although Greg Kroah-Hartman inspires you in his video to submit patches > to make the code checkpatch clean. https://www.youtube.com/watch?v=LLBrBBImJt4 HID is not a subsystem residing in drivers/staging playground though. -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web