Linux Kernel Patch

Linux Kernel Patch

[email protected]:~/linux$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: drivers/Kconfig
modified: drivers/Makefile
Untracked files:
(use "git add <file>..." to include in what will be committed)
drivers/helloworld/
no changes added to commit (use "git add" and/or "git commit -a")
[email protected]:~/linux$ git add drivers/Kconfig drivers/Makefile drivers/helloworld/
[email protected]:~/linux$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: drivers/Kconfig
modified: drivers/Makefile
new file: drivers/helloworld/Kconfig
new file: drivers/helloworld/Makefile
new file: drivers/helloworld/helloworld.c
[email protected]:~/linux$ git commit -s
Drivers: Hello World
Optimized Hello World Kernel Module
Signed-off-by: Abraham Arce <[email protected]>
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Wed May 31 18:01:26 2017 -0500
#
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# modified: drivers/Kconfig
# modified: drivers/Makefile
# new file: drivers/helloworld/Kconfig
# new file: drivers/helloworld/Makefile
# new file: drivers/helloworld/helloworld.c
#
[master b81849d] Drivers: Hello World
5 files changed, 36 insertions(+)
create mode 100644 drivers/helloworld/Kconfig
create mode 100644 drivers/helloworld/Makefile
create mode 100644 drivers/helloworld/helloworld.c
[email protected]:~/linux$ git log
commit a5f811e5cd53fc7a4a07033d57694147d5b5c914
Author: Abraham Arce <[email protected]>
Date: Wed May 31 18:01:26 2017 -0500
Drivers: Hello World
Optimized Hello World Kernel Module
Signed-off-by: Abraham Arce <[email protected]>
[email protected]:~/linux$ scripts/checkpatch.pl patches/0001-Drivers-Hello-World.patch
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#45:
new file mode 100644
WARNING: please, no spaces at the start of a line
#79: FILE: drivers/helloworld/helloworld.c:8:
+ printk(KERN_INFO "Module? Hello!\n");$
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
#79: FILE: drivers/helloworld/helloworld.c:8:
+ printk(KERN_INFO "Module? Hello!\n");
WARNING: please, no spaces at the start of a line
#80: FILE: drivers/helloworld/helloworld.c:9:
+ return 0;$
WARNING: please, no spaces at the start of a line
#85: FILE: drivers/helloworld/helloworld.c:14:
+ printk(KERN_INFO "Module? Bye!\n");$
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
#85: FILE: drivers/helloworld/helloworld.c:14:
+ printk(KERN_INFO "Module? Bye!\n");
total: 0 errors, 6 warnings, 47 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
patches/0001-Drivers-Hello-World.patch has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Git Send Email

[email protected]:~# apt install git-email
[email protected]:~/linux$ nano ~/.gitconfig
[user]
name = Abraham Arce
[push]
default = simple
[sendemail]
smtpEncryption = tls
smtpServer = smtp.gmail.com
smtpUser = [email protected]
smtpServerPort = 587
[email protected]:~/linux$ git format-patch -M origin/master
0001-Drivers-Hello-World.patch
[email protected]:~/linux$ git format-patch -M origin/master -o patches/
patches/0001-Drivers-Hello-World.patch
[email protected]:~/linux$ git send-email patches/0001-Drivers-Hello-World.patch
patches/0001-Drivers-Hello-World.patch
Who should the emails be sent to (if any)? [email protected]
Message-ID to be used as In-Reply-To for the first email (if any)?
(mbox) Adding cc: Abraham Arce <[email protected]> from line 'From: Abraham Arce <[email protected]>'
(body) Adding cc: Abraham Arce <[email protected]> from line 'Signed-off-by: Abraham Arce <[email protected]>'
From: Abraham Arce <[email protected]>
Subject: [PATCH] Drivers: Hello World
Date: Wed, 31 May 2017 18:21:18 -0500
Message-Id: <1496272878[email protected]>
X-Mailer: git-send-email 2.1.4
The Cc list above has been expanded by additional
addresses found in the patch commit message. By default
send-email prompts before sending whenever this occurs.
This behavior is controlled by the sendemail.confirm
configuration setting.
For additional information, run 'git send-email --help'.
To retain the current behavior, but squelch this message,
run 'git config --global sendemail.confirm auto'.
Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
Password for 'smtp://[email protected]@smtp.gmail.com:587':
Password for 'smtp://[email protected]@smtp.gmail.com:587':
OK. Log says:
Server: smtp.gmail.com
MAIL FROM:<[email protected]>
From: Abraham Arce <[email protected]>
Subject: [PATCH] Drivers: Hello World
Date: Wed, 31 May 2017 18:26:52 -0500
Message-Id: <1496273212[email protected]>
X-Mailer: git-send-email 2.1.4
Result: 250 2.0.0 OK 1496273188 v188sm27267079pgv.51 - gsmtp