Commit Graph

384 Commits

Author SHA1 Message Date
weihsinyeh
f52c126c43 Fix typo
Correct `parameters name` to `parameter's name` in a comment.
2024-04-16 02:38:07 +08:00
weihsinyeh
6640ccdc0f
Fix unmatched quotation (#251) 2024-04-13 13:37:28 +08:00
Jim Huang
cb41da7c27
Merge pull request #250 from 0xff07/up-to-date-irq-flags
Replace SA_xxx IRQ flags with the IRQF_xxx ones
2024-04-09 20:00:49 +08:00
Yo-Jung Lin
b9a10fe17b Replace SA_xxx IRQ flags with the IRQF_xxx ones
The SA_xxx flags has been removed for years. Nowadays the kernel uses
the IRQF_xxx flags to specify IRQ behaviors. Adjust the descriptions
in the book accordingly.
2024-04-09 19:39:18 +08:00
毛毛
470fbcd97d
Fix switch-case condition error in sample code (#245)
The code 'case -EINPROGRESS || -EBUSY: ' is the same as
'case -115 || -16 :' at compiler time, as both error code are
implemented with macro like '#define EBUSY 16'.

The code above is essentially the same as 'case 1:'. In C, there is no
real boolean value. Boolean-like value will be converted to 1 or 0.

It does not matter too much if the '-EINPROGRESS || -EBUSY' is
calculated at build time or at runtime. In both case, it will compare
the 'rc' with 1 in the switch expression. It will not compare the
'rc' with any real error code number. When the code is really '-EBUSY',
the execution will fallback to the default branch.

And in practice, most of the compilers will do this simple compile-time
static calculation, and generate code like

static int test_skcipher_result(struct skcipher_def *sk, int rc)
{
    switch (rc) {
    case 0:
        break;
    case 1:
        rc = wait_for_completion_interruptible(&sk->result.completion);
/* code removed for conciseness */
        break;
    default:
        pr_info("skcipher encrypt returned with %d result %d\n", rc,
                sk->result.err);
        break;
    }
    init_completion(&sk->result.completion);
    return rc;
}
2024-01-03 22:13:26 +08:00
Jim Huang
391f111d8a Update contributor list 2024-01-03 22:05:56 +08:00
Jim Huang
a3f5e3b931
Merge pull request #246 from mechanicalamit/egrep_to_grep_E
Change occurrences of egrep to grep -E
2024-01-03 21:59:46 +08:00
Amit Dhingra
e19b1850e1 Change occurrences of egrep to grep -E
A lot of distributions are emitting warnings when using egrep and fgrep
since these are deprecated.

Update occurrences of egrep to 'grep -E' keeping the same functionality
and making the code more portable without emitting warnings.
2024-01-03 13:07:52 +00:00
Jim Huang
15f9a4999b Proofread 2023-12-22 21:22:32 +08:00
Jim Huang
e631ad9267 Proofread 2023-12-22 21:02:18 +08:00
Jim Huang
80e400b8d2 syscall-steal: Refine comment 2023-12-22 20:53:21 +08:00
Jim Huang
e61a0d6174 Enforce consistent name scheme 2023-12-22 20:40:27 +08:00
Jim Huang
7f94878ae3
Merge pull request #244 from keytouch/fix_syscall
Fix compilation due to syscall module name conflict
2023-12-22 20:33:10 +08:00
keytouch
f2ad878e9b syscall_steal: rename sys_call_table to fix compile error
sys_call_table is already declared in arch/x86/include/asm/syscall.h but of
cource not exported by the kernel.
before this commit, gcc complains as follows:
/usr/src/linux-headers-6.1.0-16-common/arch/x86/include/asm/syscall.h:21:29:
note: previous declaration of 'sys_call_table' with type 'long int (*
const[])(const struct pt_regs *)'
   21 | extern const sys_call_ptr_t sys_call_table[];
2023-12-22 20:17:02 +08:00
keytouch
a60e84a060 syscall: rename module name to syscall_steal
In Debian, the name syscall conflicts with this patch:
in debian kernel source tree:
debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch
mailing list url:
https://lore.kernel.org/lkml/1415245982.3398.53.camel@decadent.org.uk/T/#u
which introduces a parameter named syscall.x32. So change our name.
2023-12-22 20:14:42 +08:00
Amit Dhingra
3490cd7c41
Fixed Typo (#243)
Close #242
2023-10-24 02:31:57 +08:00
Kuan-Wei Chiu
e1594ba58a
Fix typo (#240) 2023-10-08 17:14:09 +08:00
Jim Huang
c81fdd323c
Merge pull request #239 from mechanicalamit/sched_workqueue_patches
Replace schedule_work with queue_work
2023-10-07 22:51:17 +08:00
Amit Dhingra
a49c9baffa
Replace schedule_work with queue_work
schedule_work adds work to global workqueue. In this example, we create a local workqueue. Use the local workqueue by calling queue_work(), instead of putting work on the global workqueue.
2023-10-07 16:32:26 +02:00
Jim Huang
b99354a02f
Merge pull request #238 from visitorckw/fix-grammar-error
Fix grammar
2023-10-07 17:22:32 +08:00
Kuan-Wei Chiu
c0abff2dea Fix grammar
The verb 'suggest' is used with the gerund form.
2023-10-07 17:15:19 +08:00
Jim Huang
eaecd29037
Merge pull request #237 from heartofrain/master
Revise the depiction of return type of proc_create().
2023-10-07 17:12:27 +08:00
heartofrain
a8558121d9 Revise the depiction of return type of proc_create(). 2023-10-07 16:50:23 +08:00
Jim Huang
7ae8eacab0
Merge pull request #236 from mechanicalamit/lkmpgtex-tasklet
Change word in tasklet description
2023-10-07 09:19:04 +08:00
Amit Dhingra
8150c1dead
Change word in tasklet description
The word 'defator' is unable to be found in a lexicon. Change the word
'defator' with 'drawbacks' which should imply the negative meaning intended
in the sentence.
2023-10-06 23:13:09 +02:00
Jim Huang
866eba0077
Merge pull request #235 from mechanicalamit/atomic-patches
Add newline to last pr_info to force dmesg to flush
2023-09-29 02:28:23 +08:00
Amit Dhingra
e56fc58bf3 Add newline to last pr_info to force dmesg to flush
dmesg only flushes when it encounter a newline. Without a newline, the line
is held in memory pending another printk. In this particular example
(example_atomic.c), the last pr_info in atomic_bitwise() prints when
another printk happens (either by another module, or __exit for this
module.

This can be confusing to new learner. This patch adds a newline to the last
pr_info forcing dmesg to print to the screen when the module is loaded.
2023-09-28 15:32:50 +00:00
Jim Huang
7f88a37f09
Merge pull request #234 from mechanicalamit/completions-simplify
Simplify code by removal of outer struct encapsulating struct completions
2023-09-28 14:55:52 +08:00
Amit Dhingra
bf523b2332 Simplify code by removal of outer struct
Two struct completion(s) are encapsulated within another 'struct machine'.
Simplify the code by removing the outer struct and let the struct
completion(s) be self-standing.

Update description in tex to match code.
2023-09-28 06:02:39 +00:00
Jim Huang
c6b02adc98 CI: Only perform extensive checks on source file changes 2023-09-18 11:30:54 +08:00
Jim Huang
be9aa2cd4d Exclude generated files 2023-09-18 02:06:51 +08:00
Jim Huang
527e118da8 CI: Bump dependency versions 2023-09-18 02:05:28 +08:00
Jim Huang
209aa95a38 Explicitly mention 6.x kernels 2023-09-17 18:24:27 +08:00
Amit Dhingra
d0f86a29f0
Remove module * parameter from class_create() in chardev2.c (#228)
From v6.4, class_create() does not have module *
Same fix as commit 0addb868dc to chardev.c
2023-09-17 18:23:45 +08:00
Jim Huang
514f206da0
Merge pull request #226 from mechanicalamit/ioctl.c-patches
Correct name/location for ioctl-number.rst
2023-09-17 18:11:00 +08:00
Chih-En Lin
e2e8e1106d
CI: Fix "unreplaced" warnings by using git source (#229)
Because of sparse-latest.tar.gz has not been updated since 06-Sep-2021,
we are encoutering an old bug, 0e1aae55e49c ("fix "unreplaced" warnings
caused by using typeof() on inline functions") [1], that has been fixed
in the newest version. So, let's switch to the git source tree [2]
instead of using sparse-latest.tar.gz [3].

[1] https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=0e1aae55e49cad7ea43848af5b58ff0f57e7af99
[2] git://git.kernel.org/pub/scm/devel/sparse/sparse.git
[3] http://www.kernel.org/pub/software/devel/sparse/dist/sparse-latest.tar.gz
2023-09-17 18:09:48 +08:00
Amit Dhingra
6341842a9b Correct name/location for ioctl-number.rst
ioctl-number.rst in Documentation has been renamed and moved

See commits
- 049500715e7
- 08536105d93
2023-09-04 17:59:31 +00:00
Jim Huang
5fd15075f2
Merge pull request #225 from visitorckw/master
Fix typo and remove duplicated words
2023-09-04 10:01:30 +08:00
Kuan-Wei Chiu
ee617a1e53 Fix typo 2023-09-04 04:58:31 +08:00
Kuan-Wei Chiu
d45485f637 Remove duplicated words 2023-09-04 04:53:07 +08:00
Jim Huang
0ad840deec
Merge pull request #224 from fourcolor/master
Fix typo
2023-09-03 15:33:52 +08:00
Shih-Sheng Yang
34eb62045e
Fix typo 2023-09-03 13:06:13 +08:00
Amit Dhingra
0addb868dc
Remove module * parameter from class_create() (#222)
From v6.4, class_create() does not have module *
See commit 11ba11 :
> driver core: class: remove module * from class_create()
> 
> The module pointer in class_create() never actually did anything,
> and it shouldn't have been requred to be set as a parameter even
> if it did something.  So just remove it and fix up all callers of the
> function in the kernel tree at the same time.
2023-09-03 02:24:35 +08:00
Jim Huang
c94b672959
Merge pull request #223 from visitorckw/master
Fix typo
2023-09-02 22:48:12 +08:00
Kuan-Wei Chiu
292339e628 Fix typo
Capitalized the first letter in a sentence.
2023-09-02 19:57:53 +08:00
Jim Huang
863a9e247f
Merge pull request #221 from visitorckw/master
Fix typo
2023-09-01 09:00:29 +08:00
visitorckw
e976c32ceb Fix typo 2023-09-01 04:32:57 +08:00
Jim Huang
edf6615740
Merge pull request #219 from eeeXun/archlinux
Update dependencies for Arch Linux
2023-08-15 01:41:08 +08:00
eeeXun
8c33f2eee8 Update dependencies for Arch Linux 2023-08-15 00:25:14 +08:00
Jim Huang
90de6dcf9d Refine contributor list 2023-08-11 10:38:18 +08:00