From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755724Ab2CJDmN (ORCPT ); Fri, 9 Mar 2012 22:42:13 -0500 Received: from mail-pz0-f46.google.com ([209.85.210.46]:37508 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753265Ab2CJDmJ (ORCPT ); Fri, 9 Mar 2012 22:42:09 -0500 Message-ID: <4F5ACD8A.4000706@gmail.com> Date: Sat, 10 Mar 2012 11:42:02 +0800 From: Cong Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: "Chen, Dennis (SRDC SW)" CC: "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/2] Refine mutex and rcu method in module.c, kernel<3.2.9> References: <491D6B4EAD0A714894D8AD22F4BDE04303289D@SCYBEXDAG04.amd.com> <4F5780A2.2040402@gmail.com> <491D6B4EAD0A714894D8AD22F4BDE0430328E3@SCYBEXDAG04.amd.com> In-Reply-To: <491D6B4EAD0A714894D8AD22F4BDE0430328E3@SCYBEXDAG04.amd.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/07/2012 11:52 PM, Chen, Dennis (SRDC SW) wrote: > > diff -u module.ori.c module.c> module.patch > > give more details please? Let me copy-and-paste it for you as you still don't read it. :) Documentation/SubmittingPatches Use "diff -up" or "diff -uprN" to create patches. All changes to the Linux kernel occur in the form of patches, as generated by diff(1). When creating your patch, make sure to create it in "unified diff" format, as supplied by the '-u' argument to diff(1). Also, please use the '-p' argument which shows which C function each change is in - that makes the resultant diff a lot easier to read. Patches should be based in the root kernel source directory, not in any lower subdirectory. To create a patch for a single file, it is often sufficient to do: SRCTREE= linux-2.6 MYFILE= drivers/net/mydriver.c cd $SRCTREE cp $MYFILE $MYFILE.orig vi $MYFILE # make your change cd .. diff -up $SRCTREE/$MYFILE{.orig,} > /tmp/patch To create a patch for multiple files, you should unpack a "vanilla", or unmodified kernel source tree, and generate a diff against your own source tree. For example: MYSRC= /devel/linux-2.6 tar xvfz linux-2.6.12.tar.gz mv linux-2.6.12 linux-2.6.12-vanilla diff -uprN -X linux-2.6.12-vanilla/Documentation/dontdiff \ linux-2.6.12-vanilla $MYSRC > /tmp/patch