public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Markos Chandras <markos.chandras@imgtec.com>,
	Paul Burton <paul.burton@imgtec.com>,
	"Leonid Yegoshin" <Leonid.Yegoshin@imgtec.com>,
	John Crispin <blogic@openwrt.org>, <linux-mips@linux-mips.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arch: mips: kernel: traps: Remove some unused functions
Date: Fri, 2 Jan 2015 11:54:14 +0000	[thread overview]
Message-ID: <54A686E6.1040105@imgtec.com> (raw)
In-Reply-To: <CAKXHbyOLteCgVH8OMrB9zr6=eCmM8qQBN4o4_HN086mhHg+DJw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]

On 02/01/15 11:20, Rickard Strandqvist wrote:
> 2015-01-02 11:38 GMT+01:00 James Hogan <james.hogan@imgtec.com
> <mailto:james.hogan@imgtec.com>>:
> 
>     On 01/01/15 17:48, Rickard Strandqvist wrote:
>     > Removes some functions that are not used anywhere:
>     > do_bp() do_ftlb() do_dsp() do_mcheck() do_mdmx() do_msa() do_msa_fpe()
>     >
>     > This was partially found by using a static code analysis program called cppcheck.
> 
>     To elaborate on Leonid's comment, These functions are used from
>     arch/mips/kernel/genex.S. See BUILD_HANDLER assembly macro. Each one
>     builds a handle_* assembly function which saves appropriate exception
>     state and calls do_*() with return address pointing to
>     ret_from_exception. The handle_* functions are set as handlers for
>     various exceptions by set_except_vector() in arch/mips/kernel/traps.c.
> 
> Hi
> 
> Nope no New Years joke, did not even know they were something that
> occurred:)
> 
> My tests before submitting a patch is to search through the entire
> kernel after function name, see if it seems reasonable, Delete and test
> build three times as allyesconfig allmodconfig allnoconfig.
> 
> Is not mips a port of these build?

If you built on a PC then you probably would have built x86_64 kernel
images which wouldn't have used any code in arch/ except arch/x86/. To
build for another architecture you need a cross compiler, and use e.g.
ARCH=mips CROSS_COMPILE=/path/to/your/mips-linux- on your make command
line, both for the *config target and for the build itself.

In any case your best bet to know whether a source file is actually
built by the configuration (e.g. for the platform specific code you're
touching in other patches) is to check whether a corresponding .o file
is created by the build or use something like #error. Kernels are
generally built for a single platform on MIPS at the moment rather than
all of them.

You may find the following link useful to quickly get cross compilers
for different architectures:

https://www.kernel.org/pub/tools/crosstool/

Cheers
James

> 
> Kind regards
> Rickard Strandqvist


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-01-02 11:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-01 17:48 [PATCH] arch: mips: kernel: traps: Remove some unused functions Rickard Strandqvist
2015-01-02 10:38 ` James Hogan
     [not found]   ` <CAKXHbyOLteCgVH8OMrB9zr6=eCmM8qQBN4o4_HN086mhHg+DJw@mail.gmail.com>
2015-01-02 11:54     ` James Hogan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-01-01 19:34 Leonid Yegoshin

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=54A686E6.1040105@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=blogic@openwrt.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=markos.chandras@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.org \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /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