Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHEL-69075: Formatting vioinput driver with clang-format [HLK-SANITY] #1245

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Jedoku
Copy link
Contributor

@Jedoku Jedoku commented Jan 7, 2025

No description provided.

@Jedoku Jedoku requested a review from YanVugenfirer as a code owner January 7, 2025 14:09
Comment on lines +335 to +343
{
sprintf_s(buffer, sizeof(buffer), "%02x", pDescriptor[i]);
i++;
break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YanVugenfirer Do we need {} in case?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not really needed, but it was here before. No reason to have it here as there are no local variables.

Comment on lines +362 to +367
{
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_INIT, "Got axis-based vertical wheel\n");
pMouseDesc->uFlags |= CLASS_MOUSE_SUPPORTS_REL_WHEEL;
pMouseDesc->uFlags |= CLASS_MOUSE_HAS_V_WHEEL;
break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed. But I think better in another PR

Comment on lines 867 to 878
pTabletDesc->Common.cbHidReportSize = 1 + // report ID
sizeof(INPUT_CLASS_TABLET_SLOT) * pTabletDesc->uMaxContacts + // max contacts
// * per-contact
// packet. See
// INPUT_CLASS_TABLET_SLOT
// and
// INPUT_CLASS_TABLET
// for layout
// details.
1 + // Actual contact count
(pTabletDesc->bMscTs ? sizeof(LONG) : 0) // Scan time
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YanVugenfirer Maybe rewrite this part or disable the format?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better re-write

Comment on lines 36 to 40
static const ULONG ReportCodeToUsageCodeTable[] = {
/* KEY_RESERVED */
0x00,
/* KEY_ESC */ 0x29,
/* KEY_1 */ 0x1E,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same problem as in vioserial

0x01, // number of HID class descriptors
{
// DescriptorList[0]
0x22, // report descriptor type 0x22
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation issues again

Comment on lines +335 to +343
{
sprintf_s(buffer, sizeof(buffer), "%02x", pDescriptor[i]);
i++;
break;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not really needed, but it was here before. No reason to have it here as there are no local variables.

Comment on lines +362 to +367
{
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_INIT, "Got axis-based vertical wheel\n");
pMouseDesc->uFlags |= CLASS_MOUSE_SUPPORTS_REL_WHEEL;
pMouseDesc->uFlags |= CLASS_MOUSE_HAS_V_WHEEL;
break;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed. But I think better in another PR

Comment on lines 867 to 878
pTabletDesc->Common.cbHidReportSize = 1 + // report ID
sizeof(INPUT_CLASS_TABLET_SLOT) * pTabletDesc->uMaxContacts + // max contacts
// * per-contact
// packet. See
// INPUT_CLASS_TABLET_SLOT
// and
// INPUT_CLASS_TABLET
// for layout
// details.
1 + // Actual contact count
(pTabletDesc->bMscTs ? sizeof(LONG) : 0) // Scan time
;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better re-write

@Jedoku Jedoku force-pushed the RHEL-69075-Apply-clang-format-to-vioinput-driver branch 2 times, most recently from 3cfce7e to 9576343 Compare January 8, 2025 23:53
@Jedoku Jedoku force-pushed the RHEL-69075-Apply-clang-format-to-vioinput-driver branch from 9576343 to 6e99148 Compare January 9, 2025 12:30
@Jedoku Jedoku changed the title RHEL-69075: Formatting vioinput driver with clang-format RHEL-69075: Formatting vioinput driver with clang-format [HLK-SANITY] Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants