
{"id":18589,"date":"2010-12-04T23:23:19","date_gmt":"2010-12-04T17:53:19","guid":{"rendered":"http:\/\/www.froisa.com\/?p=4047"},"modified":"2010-12-04T23:23:19","modified_gmt":"2010-12-04T17:53:19","slug":"creating-a-kernel-patch-using-git","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/12\/04\/creating-a-kernel-patch-using-git\/","title":{"rendered":"Some idea about creating a linux kernel patch using Git"},"content":{"rendered":"<p><u>ABOUT creating a linux kernel patch using Git<\/u><br \/>\n[bash]<br \/>\ngit clone git:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/torvalds\/linux-2.6.git<br \/>\nInitialized empty Git repository in \/home\/jeffrin\/linux-2.6\/.git\/<br \/>\nremote: Counting objects: 1806930, done.<br \/>\nremote: Compressing objects: 100% (278260\/278260), done.<br \/>\nReceiving objects:  14% (2553100\/1806930), 117.83 MiB | 127 KiB\/s<br \/>\nResolving deltas: 100% (1513210\/1513210), done.<\/p>\n<p>$cd linux-2.6<br \/>\n$.\/scripts\/ge<br \/>\ngenksyms\/          get_maintainer.pl<\/p>\n<p>$.\/scripts\/get_maintainer.pl &#8211;file sound\/ac97_bus.c<br \/>\nJaroslav Kysela &lt;perex@perex.cz&gt;<br \/>\nTakashi Iwai &lt;tiwai@suse.de&gt;<br \/>\nalsa-devel@alsa-project.org<br \/>\nlinux-kernel@vger.kernel.org<br \/>\n$<\/p>\n<p>[\/bash]<\/p>\n<p>[bash]<\/p>\n<p>$ git status<br \/>\n# On branch master<br \/>\nnothing to commit (working directory clean)<br \/>\n$ git branch jeffrin<br \/>\n$ git branch<br \/>\n  jeffrin<br \/>\n* master<br \/>\n$ git checkout jeffrin<br \/>\nSwitched to branch &#8216;jeffrin&#8217;<br \/>\n$<br \/>\n$git status<br \/>\n# On branch jeffrin<br \/>\nnothing to commit (working directory clean)<br \/>\n$<br \/>\n$.\/scripts\/checkpatch.pl<br \/>\ncheckpatch.pl: no input files<br \/>\n$.\/scripts\/checkpatch.pl &#8211;file &#8211;terse sound\/ac97_bus.c<br \/>\nsound\/ac97_bus.c:22: WARNING: line over 80 characters<br \/>\nsound\/ac97_bus.c:75: WARNING: EXPORT_SYMBOL(foo); should immediately<br \/>\nfollow its function\/variable<br \/>\ntotal: 0 errors, 2 warnings, 77 lines checked<br \/>\n[\/bash]<br \/>\n[bash]<br \/>\n$vim sound\/ac97_bus.c +22<br \/>\n$.\/scripts\/checkpatch.pl &#8211;file &#8211;terse sound\/ac97_bus.c<br \/>\nsound\/ac97_bus.c:22: ERROR: trailing whitespace<br \/>\nsound\/ac97_bus.c:75: WARNING: EXPORT_SYMBOL(foo); should immediately<br \/>\nfollow its function\/variable<br \/>\ntotal: 1 errors, 1 warnings, 77 lines checked<br \/>\n$vim sound\/ac97_bus.c +22<br \/>\n$.\/scripts\/checkpatch.pl &#8211;file &#8211;terse sound\/ac97_bus.c<br \/>\nsound\/ac97_bus.c:75: WARNING: EXPORT_SYMBOL(foo); should immediately<br \/>\nfollow its function\/variable<br \/>\ntotal: 0 errors, 1 warnings, 77 lines checked<br \/>\n$vim sound\/ac97_bus.c +75<br \/>\n[\/bash]<br \/>\n[bash]<br \/>\n$git status<br \/>\n# On branch jeffrin<br \/>\n# Changed but not updated:<br \/>\n#   (use &quot;git add &#8230;&quot; to update what will be committed)<br \/>\n#   (use &quot;git checkout &#8212; &#8230;&quot; to discard changes in working directory)<br \/>\n#<br \/>\n#\tmodified:   sound\/ac97_bus.c<br \/>\n#<br \/>\nno changes added to commit (use &quot;git add&quot; and\/or &quot;git commit -a&quot;)<br \/>\n$git diff<br \/>\ndiff &#8211;git a\/sound\/ac97_bus.c b\/sound\/ac97_bus.c<br \/>\nindex a351dd0..c93251a 100644<br \/>\n&#8212; a\/sound\/ac97_bus.c<br \/>\n+++ b\/sound\/ac97_bus.c<br \/>\n@@ -19,9 +19,9 @@<\/p>\n<p> \/*<br \/>\n  * Let drivers decide whether they want to support given codec from their<br \/>\n&#8211; * probe method.  Drivers have direct access to the struct snd_ac97 structure and may<br \/>\n&#8211; * decide based on the id field amongst other things.<br \/>\n&#8211; *\/<br \/>\n+ * probe method. Drivers have direct access to the struct snd_ac97<br \/>\n+ * structure and may  decide based on the id field amongst other things.<br \/>\n+*\/<br \/>\n static int ac97_bus_match(struct device *dev, struct device_driver *drv)<br \/>\n {<br \/>\n        return 1;<br \/>\n$<br \/>\n[\/bash]<\/p>\n<p>[bash]<\/p>\n<p>$git commit sound\/ac97_bus.c<br \/>\n[jeffrin a2c2867] sound: Fixed line limit issue in sound\/ac97_bus.c<br \/>\nThis is a patch to the sound\/ac97_bus.c file that fixes up a 80<br \/>\ncharacter line limit issue found by the checkpatch.pl tool.<br \/>\nSigned-off-by: Jeffrin Jose<br \/>\n 1 files changed, 3 insertions(+), 3 deletions(-)<br \/>\n$git show HEAD<br \/>\ncommit a2c2867876c246420a199a0fb4c36ad29100a42cc<br \/>\nAuthor: Jeffrin Jose<br \/>\nDate:   Mon Dec 6 19:27:53 2010 +0530<\/p>\n<p>    sound: Fixed line limit issue in sound\/ac97_bus.c<br \/>\n    This is a patch to the sound\/ac97_bus.c file that fixes up a 80 character<br \/>\n    line limit issue found by the checkpatch.pl tool.<br \/>\n    Signed-off-by: Jeffrin Jose<\/p>\n<p>diff &#8211;git a\/sound\/ac97_bus.c b\/sound\/ac97_bus.c<br \/>\nindex a351dd0..c93251a 100644<br \/>\n&#8212; a\/sound\/ac97_bus.c<br \/>\n+++ b\/sound\/ac97_bus.c<br \/>\n@@ -19,9 +19,9 @@<\/p>\n<p> \/*<br \/>\n  * Let drivers decide whether they want to support given codec from their<br \/>\n&#8211; * probe method.  Drivers have direct access to the struct snd_ac97 structure and may<br \/>\n&#8211; * decide based on the id field amongst other things.<br \/>\n&#8211; *\/<br \/>\n+ * probe method. Drivers have direct access to the struct snd_ac97<br \/>\n+ * structure and may  decide based on the id field amongst other things.<br \/>\n+*\/<br \/>\n static int ac97_bus_match(struct device *dev, struct device_driver *drv)<br \/>\n {<br \/>\n        return 1;<br \/>\n[\/bash]<br \/>\n[bash]<br \/>\n$git format-patch master..jeffrin<br \/>\n0001-sound-Fixed-line-limit-issue-in-sound-ac97_bus.c.patch<br \/>\n[\/bash]<br \/>\n[bash]<br \/>\n$.\/scripts\/checkpatch.pl 0001-sound-Fixed-line-limit-issue-in-sound-ac97_bus.c.patch<br \/>\ntotal: 0 errors, 0 warnings, 12 lines checked<\/p>\n<p>0001-sound-Fixed-line-limit-issue-in-sound-ac97_bus.c.patch has no obvious style<br \/>\nproblems and is ready for submission.<br \/>\n$<br \/>\n[\/bash]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ABOUT creating a linux kernel patch using Git [bash] git clone git:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/torvalds\/linux-2.6.git Initialized empty Git repository in \/home\/jeffrin\/linux-2.6\/.git\/ remote: Counting objects: 1806930, done. remote: Compressing objects: 100% (278260\/278260), done. Receiving objects: 14% (2553100\/1806930), 117.83 MiB | 127 KiB\/s Resolving deltas: 100% (1513210\/1513210), done. $cd linux-2.6 $.\/scripts\/ge genksyms\/ get_maintainer.pl $.\/scripts\/get_maintainer.pl &#8211;file sound\/ac97_bus.c Jaroslav Kysela &lt;perex@perex.cz&gt; Takashi &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/12\/04\/creating-a-kernel-patch-using-git\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Some idea about creating a linux kernel patch using Git&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[49],"tags":[988,1239],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/18589"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=18589"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/18589\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=18589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=18589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=18589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}