Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usbhost/usbhost_xboxcontroller.c compilation error #483

Closed
robin-raymond opened this issue Mar 7, 2020 · 3 comments
Closed

usbhost/usbhost_xboxcontroller.c compilation error #483

robin-raymond opened this issue Mar 7, 2020 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@robin-raymond
Copy link

CC:  usbhost/usbhost_xboxcontroller.c
usbhost/usbhost_xboxcontroller.c: In function 'usbhost_notify':
usbhost/usbhost_xboxcontroller.c:561:36: error: 'struct usbhost_state_s' has no member named 'fds'
       FAR struct pollfd *fds = priv->fds[i];
                                    ^~
usbhost/usbhost_xboxcontroller.c: In function 'usbhost_poll':
usbhost/usbhost_xboxcontroller.c:2136:20: error: 'struct usbhost_state_s' has no member named 'fds'
           if (!priv->fds[i])
                    ^~
usbhost/usbhost_xboxcontroller.c:2140:19: error: 'struct usbhost_state_s' has no member named 'fds'
               priv->fds[i] = fds;
                   ^~
usbhost/usbhost_xboxcontroller.c:2141:35: error: 'struct usbhost_state_s' has no member named 'fds'
               fds->priv    = &priv->fds[i];
                                   ^~
usbhost/usbhost_xboxcontroller.c:2159:11: warning: implicit declaration of function 'usbhost_pollnotify' [-Wimplicit-function-declaration]
           usbhost_pollnotify(priv);
           ^~~~~~~~~~~~~~~~~~

Think it's missing:

  /* The following is a list if poll structures of threads waiting for
   * driver events. The 'struct pollfd' reference for each open is also
   * retained in the f_priv field of the 'struct file'.
   */

  struct pollfd *fds[CONFIG_HIDMOUSE_NPOLLWAITERS];

inside struct usbhost_state_s

But I'm not entirely sure if that's the right fix.

@robin-raymond
Copy link
Author

robin-raymond commented Mar 7, 2020

related -- I think a forward declaration is missing:

static void usbhost_pollnotify(FAR struct usbhost_state_s *dev);

(and implementation)

@patacongo patacongo added bug Something isn't working good first issue Good for newcomers labels Mar 7, 2020
@acassis
Copy link
Contributor

acassis commented Mar 7, 2020

Hi Robin,
I think you fix is fine, could you please submit a PR ?

@patacongo
Copy link
Contributor

Resolved with PR #485

acassis added a commit that referenced this issue Mar 7, 2020
Author: Alan Carvalho de Assis <[email protected]>
    Fix all nxstyle reported issues

Author: Robin Raymond <[email protected]>
    Fixed compilation issue with poll fds notification.
    #483
aenrbes pushed a commit to aenrbes/nuttx-on-litex-vexriscv that referenced this issue Mar 20, 2020
Author: Alan Carvalho de Assis <[email protected]>
    Fix all nxstyle reported issues

Author: Robin Raymond <[email protected]>
    Fixed compilation issue with poll fds notification.
    apache#483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants