Skip to content

Skel2hid#255

Draft
qrsikno2 wants to merge 7 commits intoluainkernel:masterfrom
qrsikno2:skel2hid
Draft

Skel2hid#255
qrsikno2 wants to merge 7 commits intoluainkernel:masterfrom
qrsikno2:skel2hid

Conversation

@qrsikno2
Copy link
Copy Markdown
Contributor

copy from hid-generic to lunatik.

@lneto
Copy link
Copy Markdown
Contributor

lneto commented May 28, 2025

@qrsikno2 I don't see you adding luahid in here.. https://github.com/luainkernel/lunatik/blob/master/bin/lunatik#L10

Comment thread lib/luahid.c Outdated

#include <lunatik.h>

#include "luanetfilter.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That is because i need to use the good macro developed by sheharyaar

	lunatik_setstring(L, 1, user_driver, name, NAME_MAX);

in Line 88

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so we should move this macro to lunatik.h

@qrsikno2
Copy link
Copy Markdown
Contributor Author

@qrsikno2 I don't see you adding luahid in here.. https://github.com/luainkernel/lunatik/blob/master/bin/lunatik#L10

fixed

Comment thread lunatik.h
Comment thread lib/luahid.c Outdated
}
lunatik_setruntime(L, hid, hid);
lunatik_getobject(hid->runtime);
// pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does pass mean here? Btw, please don't use cpp comment style..

Comment thread lib/luahid.c

//configure the driver's properties & callbacks
struct hid_driver *user_driver = &(hid->driver);
user_driver -> name = lunatik_checkalloc(L, NAME_MAX);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please mind our code style.. when in doubt, use Linux's code style.. no space around ->

Comment thread lib/luahid.c Outdated
struct hid_driver driver;
} luahid_t;

//kernel codes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Always refer to the original if you are borrowing something

@lneto lneto force-pushed the master branch 2 times, most recently from 17ac113 to 925bfd9 Compare July 14, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants