> For the complete documentation index, see [llms.txt](https://richardweiyang-2.gitbook.io/kernel-exploring/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://richardweiyang-2.gitbook.io/kernel-exploring/handy_tools/01-patch.md).

# 发补丁

发patch是和社区交流的重要过程，这个过程也有相关的规范要遵守。比如检查代码格式和确认需要发给谁。

## 检查patch

内核代码有着自己的规范，在发patch前最好用脚本checkpatch.pl检查一下。

检查某个commit

```
./scripts/checkpatch.pl -g HEAD
```

检查某个patch文件

```
./scripts/checkpatch.pl /patch/to/patch/file
```

## 查要发给谁

写完patch后，我们需要发到社区。具体发到哪里，需要发给谁也是有讲究的。可以用get\_maintainer.pl来查看。

```
./scripts/get_maintainer.pl /patch/to/patch/file
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://richardweiyang-2.gitbook.io/kernel-exploring/handy_tools/01-patch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
