linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Govindraj <govindraj.ti-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	Linux USB Mailing List
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux OMAP Mailing List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Greg KH
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v2] usb: host: ehci: allow ehci_* symbols to be unused
Date: Wed, 15 Feb 2012 18:03:43 +0200	[thread overview]
Message-ID: <20120215160342.GC32073@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <CAAL8m4z72at5heepktM1ieQHFKkApzVY9OzO-hte-U=AZfA=nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

Hi,

On Wed, Feb 15, 2012 at 09:27:35PM +0530, Govindraj wrote:
> On Wed, Feb 15, 2012 at 1:04 PM, Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org> wrote:
> > not all platforms will use all of those ehci_*
> > symbols on their hc_driver structure. Sometimes
> > we might need to provide a modified version of
> > a certain method or not provide it at all, as is
> > the case with OMAPs which don't support port handoff
> > feature.
> >
> > Whenever we compile a kernel for an OMAP board with
> > EHCI enabled, we get compile warnings:
> >
> > drivers/usb/host/ehci-hub.c:1079: warning: 'ehci_relinquish_port' \
> >        defined but not used
> > drivers/usb/host/ehci-hub.c:1088: warning: 'ehci_port_handed_over' \
> >        defined but not used
> >
> > In order to cleanup those warnings, we're adding
> > __maybe_unused annotation to those functions.
> >
> > Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
> > ---
> >
> > Changes from v1:
> >        - only add __maybe_used to relinquish_port, port_handed_over
> >                and port_change
> >
> >  drivers/usb/host/ehci-hub.c |    8 +++++---
> >  1 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> > index 77bbb23..01011dd 100644
> > --- a/drivers/usb/host/ehci-hub.c
> > +++ b/drivers/usb/host/ehci-hub.c
> > @@ -107,7 +107,7 @@ static void ehci_handover_companion_ports(struct ehci_hcd *ehci)
> >        ehci->owned_ports = 0;
> >  }
> >
> > -static int ehci_port_change(struct ehci_hcd *ehci)
> > +static int __maybe_unused ehci_port_change(struct ehci_hcd *ehci)
> 
> should be __maybe_used ? and in rest of the patch

why ? That isn't even defined anywhere. Take a look at
<linux/compiler-gcc.h>

| /*
|  * From the GCC manual:
|  *
|  * Many functions have no effects except the return value and their
|  * return value depends only on the parameters and/or global
|  * variables.  Such a function can be subject to common subexpression
|  * elimination and loop optimization just as an arithmetic operator
|  * would be.
|  * [...]
|  */
| #define __pure				__attribute__((pure))
| #define __aligned(x)			__attribute__((aligned(x)))
| #define __printf(a,b)			__attribute__((format(printf,a,b)))
| #define  noinline			__attribute__((noinline))
| #define __attribute_const__		__attribute__((__const__))
| #define __maybe_unused			__attribute__((unused))
| #define __always_unused			__attribute__((unused))

did you try to search for a definition of __maybe_used ? It doesn't
exist, try:

$ git grep -e __maybe_used include/

on a git kernel tree. Besides, if we had a __maybe_used flag, it
wouldn't survive very long as semantically they would be essentially the
same.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      parent reply	other threads:[~2012-02-15 16:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14  9:14 [PATCH] usb: host: ehci: allow ehci_* symbols to be unused Felipe Balbi
2012-02-14 15:06 ` Alan Stern
2012-02-14 16:01   ` Felipe Balbi
2012-02-14 20:11     ` Alan Stern
     [not found]       ` <Pine.LNX.4.44L0.1202141505400.1544-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-02-15  7:34         ` [PATCH v2] " Felipe Balbi
2012-02-15 15:48           ` Alan Stern
     [not found]           ` <1329291266-15798-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2012-02-15 15:57             ` Govindraj
     [not found]               ` <CAAL8m4z72at5heepktM1ieQHFKkApzVY9OzO-hte-U=AZfA=nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-15 16:03                 ` Felipe Balbi [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=20120215160342.GC32073@legolas.emea.dhcp.ti.com \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=govindraj.ti-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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).