Hi Allen,

[auto build test ERROR on v4.14-rc6]
[cannot apply to hid/for-next next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Allen-Pais/drivers-hid-Convert-timers-to-use-timer_setup/20171025-230118
config: x86_64-randconfig-x011-201743 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/ioport.h:12:0,
                    from include/linux/device.h:16,
                    from drivers/hid/hid-appleir.c:26:
   drivers/hid/hid-appleir.c: In function 'key_up_tick':
>> drivers/hid/hid-appleir.c:178:39: error: 'applier' undeclared (first use in 
>> this function)
     struct appleir *appleir = from_timer(applier, t, key_up_timer);
                                          ^
   include/linux/compiler.h:553:19: note: in definition of macro 
'__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:576:2: note: in expansion of macro 
'_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:46:37: note: in expansion of macro 
'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:20: note: in expansion of macro '__same_type'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                       ^~~~~~~~~~~
   include/linux/timer.h:183:2: note: in expansion of macro 'container_of'
     container_of(callback_timer, typeof(*var), timer_fieldname)
     ^~~~~~~~~~~~
>> drivers/hid/hid-appleir.c:178:28: note: in expansion of macro 'from_timer'
     struct appleir *appleir = from_timer(applier, t, key_up_timer);
                               ^~~~~~~~~~
   drivers/hid/hid-appleir.c:178:39: note: each undeclared identifier is 
reported only once for each function it appears in
     struct appleir *appleir = from_timer(applier, t, key_up_timer);
                                          ^
   include/linux/compiler.h:553:19: note: in definition of macro 
'__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:576:2: note: in expansion of macro 
'_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:46:37: note: in expansion of macro 
'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:20: note: in expansion of macro '__same_type'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                       ^~~~~~~~~~~
   include/linux/timer.h:183:2: note: in expansion of macro 'container_of'
     container_of(callback_timer, typeof(*var), timer_fieldname)
     ^~~~~~~~~~~~
>> drivers/hid/hid-appleir.c:178:28: note: in expansion of macro 'from_timer'
     struct appleir *appleir = from_timer(applier, t, key_up_timer);
                               ^~~~~~~~~~

vim +/applier +178 drivers/hid/hid-appleir.c

  > 26  #include <linux/device.h>
    27  #include <linux/hid.h>
    28  #include <linux/module.h>
    29  #include "hid-ids.h"
    30  
    31  MODULE_AUTHOR("James McKenzie");
    32  MODULE_AUTHOR("Benjamin Tissoires <benjamin.tissoi...@redhat.com>");
    33  MODULE_DESCRIPTION("HID Apple IR remote controls");
    34  MODULE_LICENSE("GPL");
    35  
    36  #define KEY_MASK                0x0F
    37  #define TWO_PACKETS_MASK        0x40
    38  
    39  /*
    40   * James McKenzie has two devices both of which report the following
    41   * 25 87 ee 83 0a       +
    42   * 25 87 ee 83 0c       -
    43   * 25 87 ee 83 09       <<
    44   * 25 87 ee 83 06       >>
    45   * 25 87 ee 83 05       >"
    46   * 25 87 ee 83 03       menu
    47   * 26 00 00 00 00       for key repeat
    48   */
    49  
    50  /*
    51   * Thomas Glanzmann reports the following responses
    52   * 25 87 ee ca 0b       +
    53   * 25 87 ee ca 0d       -
    54   * 25 87 ee ca 08       <<
    55   * 25 87 ee ca 07       >>
    56   * 25 87 ee ca 04       >"
    57   * 25 87 ee ca 02       menu
    58   * 26 00 00 00 00       for key repeat
    59   *
    60   * He also observes the following event sometimes
    61   * sent after a key is release, which I interpret
    62   * as a flat battery message
    63   * 25 87 e0 ca 06       flat battery
    64   */
    65  
    66  /*
    67   * Alexandre Karpenko reports the following responses for Device ID 
0x8242
    68   * 25 87 ee 47 0b       +
    69   * 25 87 ee 47 0d       -
    70   * 25 87 ee 47 08       <<
    71   * 25 87 ee 47 07       >>
    72   * 25 87 ee 47 04       >"
    73   * 25 87 ee 47 02       menu
    74   * 26 87 ee 47 **       for key repeat (** is the code of the key being 
held)
    75   */
    76  
    77  /*
    78   * Bastien Nocera's remote
    79   * 25 87 ee 91 5f       followed by
    80   * 25 87 ee 91 05       gives you >"
    81   *
    82   * 25 87 ee 91 5c       followed by
    83   * 25 87 ee 91 05       gives you the middle button
    84   */
    85  
    86  /*
    87   * Fabien Andre's remote
    88   * 25 87 ee a3 5e       followed by
    89   * 25 87 ee a3 04       gives you >"
    90   *
    91   * 25 87 ee a3 5d       followed by
    92   * 25 87 ee a3 04       gives you the middle button
    93   */
    94  
    95  static const unsigned short appleir_key_table[] = {
    96          KEY_RESERVED,
    97          KEY_MENU,
    98          KEY_PLAYPAUSE,
    99          KEY_FORWARD,
   100          KEY_BACK,
   101          KEY_VOLUMEUP,
   102          KEY_VOLUMEDOWN,
   103          KEY_RESERVED,
   104          KEY_RESERVED,
   105          KEY_RESERVED,
   106          KEY_RESERVED,
   107          KEY_RESERVED,
   108          KEY_RESERVED,
   109          KEY_RESERVED,
   110          KEY_ENTER,
   111          KEY_PLAYPAUSE,
   112          KEY_RESERVED,
   113  };
   114  
   115  struct appleir {
   116          struct input_dev *input_dev;
   117          struct hid_device *hid;
   118          unsigned short keymap[ARRAY_SIZE(appleir_key_table)];
   119          struct timer_list key_up_timer; /* timer for key up */
   120          spinlock_t lock;                /* protects .current_key */
   121          int current_key;                /* the currently pressed key */
   122          int prev_key_idx;               /* key index in a 2 packets 
message */
   123  };
   124  
   125  static int get_key(int data)
   126  {
   127          /*
   128           * The key is coded accross bits 2..9:
   129           *
   130           * 0x00 or 0x01 (        )      key:  0         -> KEY_RESERVED
   131           * 0x02 or 0x03 (  menu  )      key:  1         -> KEY_MENU
   132           * 0x04 or 0x05 (   >"   )      key:  2         -> KEY_PLAYPAUSE
   133           * 0x06 or 0x07 (   >>   )      key:  3         -> KEY_FORWARD
   134           * 0x08 or 0x09 (   <<   )      key:  4         -> KEY_BACK
   135           * 0x0a or 0x0b (    +   )      key:  5         -> KEY_VOLUMEUP
   136           * 0x0c or 0x0d (    -   )      key:  6         -> 
KEY_VOLUMEDOWN
   137           * 0x0e or 0x0f (        )      key:  7         -> KEY_RESERVED
   138           * 0x50 or 0x51 (        )      key:  8         -> KEY_RESERVED
   139           * 0x52 or 0x53 (        )      key:  9         -> KEY_RESERVED
   140           * 0x54 or 0x55 (        )      key: 10         -> KEY_RESERVED
   141           * 0x56 or 0x57 (        )      key: 11         -> KEY_RESERVED
   142           * 0x58 or 0x59 (        )      key: 12         -> KEY_RESERVED
   143           * 0x5a or 0x5b (        )      key: 13         -> KEY_RESERVED
   144           * 0x5c or 0x5d ( middle )      key: 14         -> KEY_ENTER
   145           * 0x5e or 0x5f (   >"   )      key: 15         -> KEY_PLAYPAUSE
   146           *
   147           * Packets starting with 0x5 are part of a two-packets message,
   148           * we notify the caller by sending a negative value.
   149           */
   150          int key = (data >> 1) & KEY_MASK;
   151  
   152          if ((data & TWO_PACKETS_MASK))
   153                  /* Part of a 2 packets-command */
   154                  key = -key;
   155  
   156          return key;
   157  }
   158  
   159  static void key_up(struct hid_device *hid, struct appleir *appleir, int 
key)
   160  {
   161          input_report_key(appleir->input_dev, key, 0);
   162          input_sync(appleir->input_dev);
   163  }
   164  
   165  static void key_down(struct hid_device *hid, struct appleir *appleir, 
int key)
   166  {
   167          input_report_key(appleir->input_dev, key, 1);
   168          input_sync(appleir->input_dev);
   169  }
   170  
   171  static void battery_flat(struct appleir *appleir)
   172  {
   173          dev_err(&appleir->input_dev->dev, "possible flat battery?\n");
   174  }
   175  
   176  static void key_up_tick(struct timer_list *t)
   177  {
 > 178          struct appleir *appleir = from_timer(applier, t, key_up_timer);
   179          struct hid_device *hid = appleir->hid;
   180          unsigned long flags;
   181  
   182          spin_lock_irqsave(&appleir->lock, flags);
   183          if (appleir->current_key) {
   184                  key_up(hid, appleir, appleir->current_key);
   185                  appleir->current_key = 0;
   186          }
   187          spin_unlock_irqrestore(&appleir->lock, flags);
   188  }
   189  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to