Skip to content

Conversation

@qrsikno2
Copy link
Contributor

copy from hid-generic to lunatik.

@lneto
Copy link
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

lib/luahid.c Outdated

#include <lunatik.h>

#include "luanetfilter.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
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
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
Contributor Author

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

fixed

lib/luahid.c Outdated
}
lunatik_setruntime(L, hid, hid);
lunatik_getobject(hid->runtime);
// pass
Copy link
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..


//configure the driver's properties & callbacks
struct hid_driver *user_driver = &(hid->driver);
user_driver -> name = lunatik_checkalloc(L, NAME_MAX);
Copy link
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 ->

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

//kernel codes
Copy link
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