The traditional file name extension for this is “.diff”, and if you use a tool to update based on local files then the tool is “patch”. You might consider just updating the lines by hand with an editor to see what it’s doing.
Sorry, more explanation is a bit long, I don’t know what you already know about diff, patch, and git tools.
git has some ability to compare one file against a git repo file assuming you have access to the repo. I don’t know about the corrupt patch note, but I see this as your first line being different than the patch (this assumes what you pasted here is the same as what you used…perhaps other lines were also changed due to copy and paste errors…note the extra space in this case):
# Your .diff:
diff --git a/arch/arm/mach-tegra/board-ardbeg-panel.c b/arch/arm/<b>mach- tegra</b>/board-ardbeg-panel.c
# Web URL's .diff:
diff --git a/arch/arm/mach-tegra/board-ardbeg-panel.c b/arch/arm/<b>mach-tegra</b>/board-ardbeg-panel.c
Typically at the top of a patch file you’d see two file paths. One is an original file, another is the destination to patch to make those blocks of code the same. The diff tool creating the diff file requires both files to be present; the patch tool requires a diff file (a specification of differences) and the destination file to edit (diff finds differences, patch reverses differences). Often the paths are shown as relative paths like this:
a/some/path/file.c
b/some/path/file.c
…in this example the “a/” and “b/” are “levels”. If you cd to a directory where you see the file path “b/some/path/file.c”, then you’d just use “patch” without a “-pNumber” (or with “-p0” which is the same as no stripping of a path element or level). If you had done a “cd b/some/” from that sample location (you performed a cd to two directories closer to the edit file), then you’d need to strip two levels for the patch tool, and the patch command would be:
patch -p2 < patchfile.diff
(see “man patch”)
git can deal with differences using git repositories. git can generate a diff file based on file revisions or different repositories. git can patch with a diff. The diff tool requires two exact hard files and does not understand repositories or revision numbers; git can refer to different file revision specifications (versus hard files) in a git repo. You are patching to a local file and have a “.diff” file for specification, so you do not need to use the git command. The reason you might be interested in git is that instead of copy and paste to create a diff file you could just use git if you know the remote git file specification.
Think of something like this:
cd /where/ever/kernel/source/is/
cd arch/arm/mach-tegra/
patch -p3 < /where/ever/it/is/the_diff_file.diff
The “-p3” is because you want to strip 3 leading directories of:
b/arch/arm/mach-tegra/board-ardbeg-panel.c
(you are in “mach-tegra”, your cd took away the meaning of “b/arch/arm/” and puts you in “mach-tegra/”)