public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	Ian Abbott <ian.abbott@mev.co.uk>,
	"fmhess@users.sourceforge.net" <fmhess@users.sourceforge.net>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] staging: comedi: ni_mio_common.c: local functions should be static
Date: Wed, 6 Jun 2012 11:16:39 +0100	[thread overview]
Message-ID: <4FCF2E07.1090401@mev.co.uk> (raw)
In-Reply-To: <201206051120.22177.hartleys@visionengravers.com>

On 2012-06-05 19:20, H Hartley Sweeten wrote:
> Local functions should be marked static to prevent them from
> being exposed globally.
>
> This quiets the following sparse warnings:
>
> warning: symbol 'ni_release_gpct_mite_channel' was not declared. Should it be static?
> warning: symbol 'ni_prime_channelgain_list' was not declared. Should it be static?
>
> Signed-off-by: H Hartley Sweeten<hsweeten@visionengravers.com>
> Cc: Ian Abbott<abbotti@mev.co.uk>
> Cc: Mori Hess<fmhess@users.sourceforge.net>
> Cc: Greg Kroah-Hartman<gregkh@linuxfoundation.org>
>
> ---
>
> diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
> index fd232bc..3b3a0b1 100644
> --- a/drivers/staging/comedi/drivers/ni_mio_common.c
> +++ b/drivers/staging/comedi/drivers/ni_mio_common.c
> @@ -644,7 +644,7 @@ static void ni_release_ao_mite_channel(struct comedi_device *dev)
>   #endif /*  PCIDMA */
>   }
>
> -void ni_release_gpct_mite_channel(struct comedi_device *dev,
> +static void ni_release_gpct_mite_channel(struct comedi_device *dev,
>   				  unsigned gpct_index)
>   {
>   #ifdef PCIDMA
> @@ -1880,7 +1880,7 @@ static int ni_ai_insn_read(struct comedi_device *dev,
>   	return insn->n;
>   }

This results in a compiler warning about the unused function 
ni_release_gpct_mite_channel when compiling ni_atmio.c.  It was unused 
before of course, but now it is static, the compiler realizes it!

It could be fixed for now by moving the '#ifdef PCIDMA' and matching 
'#endif' to surround the whole function, though I guess we want to try 
and get rid of the #ifdef's eventually.  It's tricky because 
ni_mio_common.c isn't a standalone compilation unit, it's #include'd by 
some other .c files.  We might need to have a go at splitting it up at 
some point.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

  reply	other threads:[~2012-06-06 10:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05 18:20 [PATCH] staging: comedi: ni_mio_common.c: local functions should be static H Hartley Sweeten
2012-06-06 10:16 ` Ian Abbott [this message]
2012-06-06 16:22   ` H Hartley Sweeten
2012-06-06 17:01     ` Ian Abbott

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=4FCF2E07.1090401@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hartleys@visionengravers.com \
    --cc=ian.abbott@mev.co.uk \
    --cc=linux-kernel@vger.kernel.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