mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Arun Chandran <achandran@mvista.com>
Cc: linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>,
	Geoff Levand <geoff@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Re: checkpatch.pl: Use of extern in function prototype
Date: Mon, 18 Aug 2014 06:18:25 -0700	[thread overview]
Message-ID: <1408367905.5871.5.camel@joe-AO725> (raw)
In-Reply-To: <CAFdej00nLYi__6STxb7wMGXR9iCSYF-VBFc9DjjYo3_rwYnm7Q@mail.gmail.com>

On Mon, 2014-08-18 at 15:09 +0530, Arun Chandran wrote:
> Hi,
> 
> I have a piece of code as shown below.
> 
> #######################
> diff --git a/arch/arm64/include/asm/proc-fns.h
> b/arch/arm64/include/asm/proc-fns.h
> index 9a8fd84..86be4f9 100644
> --- a/arch/arm64/include/asm/proc-fns.h
> +++ b/arch/arm64/include/asm/proc-fns.h
> @@ -32,7 +32,7 @@ extern void cpu_cache_off(void);
>  extern void cpu_do_idle(void);
>  extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
>  extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
> +extern void cpu_soft_restart(phys_addr_t cpu_reset,
>                 unsigned long addr) __attribute__((noreturn));
>  extern void cpu_do_suspend(struct cpu_suspend_ctx *ptr);
>  extern u64 cpu_do_resume(phys_addr_t ptr, u64 idmap_ttbr);
> ########################
> 
> Other lines had an "extern" in them I also added it blindly.
> when the above code is given checkpatch.pl did not throw any
> error/warning,; but I got this reply
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/279691.html
> 
> [[As the functions have external linkage by default, the extern keyword is
> irrelevant in this case.]]
> 
> Does checkpatch.pl misbehave in my case?

checkpatch's "unnecessary extern" message is somewhat controversial.

It requires the use of "--strict" on the command line.




      reply	other threads:[~2014-08-18 13:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18  9:39 Arun Chandran
2014-08-18 13:18 ` Joe Perches [this message]

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=1408367905.5871.5.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=achandran@mvista.com \
    --cc=apw@canonical.com \
    --cc=geoff@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    /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

all inboxes | Powered by JetHome®