kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Better testing when patching divers/staging/ - howto?
Date: Fri, 5 Sep 2014 11:54:45 -0700	[thread overview]
Message-ID: <20140905185445.GA24174@kroah.com> (raw)
In-Reply-To: <20140905164241.GF28079@fu>

On Fri, Sep 05, 2014 at 06:42:41PM +0200, Matthias Beyer wrote:
> Hi,
> 
> I do big (cleanup) changes in
> 
>     drivers/staging/bcm/
> 
> Recently, I managed to piss off greg-kh by sending in a patch that
> broke the build[0].
> 
> After some time off, I want to re-start doing patches in this driver
> and of course do better!

Try test-building your patches, that's a good start :)

> What I do by now:
> 
>     1) Patching until my task is done. For example outsourcing stuff
>     from functions in a file.
> 
>     2) Before sending my patchset, compiling the appropriate patches
>     like so:
> 
>         make drivers/staging/bcm/

Don't also forget a general 'make' for the whole tree, otherwise
undefined symbols that you might have deleted from the module will not
show up if you just build one subdirectory.

>     3) If it builds, generating patches, checking them and sending
>     them.
> 
>         git format-patch gregkh-staging/staging-next..HEAD # more args
>         scripts/checkpatch.pl ./00*
>         git send-email # some args
> 
> The error mentioned in [0] wasn't thrown when doing 2).

Because you only built the subdirectory...

> My question to you: How to do better? How to test the patches even
> more? By building a whole kernel with them?

Yes.

> Is that what greg-kh did and where the error he mentioned in [0] comes
> from?

Yes.

> Or is there a test-suite-like thing around I just didn't discover yet?

Nope.

> I do not have that much ressources to always build a full kernel for
> only one patchset, so would it be okay to (locally) merge my patchsets
> into a temporary branch and build a (allyesconfig) kernel out of all
> my patchsets?

Why?  If you just change one file, 'make' will only rebuild that one
file.

Also do a faster make, with the -j option.  Pass in 2x the number of CPU
cores you have, so if you have 2 cores do:
	make -j4

to get a _much_ faster build.

> In addition, I do not have the appropriate hardware to actually _run_
> the code. I always state this in my patchset messages, of course!

It would be great if you could find some hardware, I really want to just
delete this driver as no one seems to have the hardware anymore.
You can only clean up just so much stuff without having to start to
change the logic in the code, and you need the hardware to test that.

hope this helps,

greg k-h

  reply	other threads:[~2014-09-05 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 16:42 Better testing when patching divers/staging/ - howto? Matthias Beyer
2014-09-05 18:54 ` Greg KH [this message]
2014-09-05 19:09   ` Valdis.Kletnieks at vt.edu
2014-09-05 20:02   ` Mandeep Sandhu
2014-09-05 20:11     ` Greg KH
2014-09-05 20:31       ` Mandeep Sandhu
2014-09-05 20:11   ` Matthias Beyer
2014-09-05 22:17     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140905185445.GA24174@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).