Re: Documentation/networking/timestamping/txtimestamp.c:118:7: error: 'SCM_TSTAMP_SCHED' undeclared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Willem,

On Sat, Jan 10, 2015 at 12:36:26PM -0500, Willem de Bruijn wrote:
> Hi Fengguang,
> 
> The compilation fails, because this target depends on make
> headers_install. This dependency is implicit, unless the directory is
> built as part of target Documentation (not M=Documentation).
> 
> Make will handle the headers_install dependency and build these files
> correctly if config flags
> 
>   CONFIG_HEADERS_CHECK=y
>   CONFIG_BUILD_DOCSRC=y
> 
> are enabled. Can you consider adding these to the test robot?

OK, done, thank you for the suggestion!

Regards,
Fengguang

> On Fri, Jan 9, 2015 at 10:42 PM, kbuild test robot
> <fengguang.wu@xxxxxxxxx> wrote:
> > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   dc9319f5a3e1f67d2a2fbf190e30f6d03f569fed
> > commit: 8fe2f761cae9da9f9031162f104164a812ce78ab net-timestamp: expand documentation
> > date:   4 months ago
> > config: x86_64-rhel (attached as .config)
> > reproduce:
> >   git checkout 8fe2f761cae9da9f9031162f104164a812ce78ab
> >   # save the attached .config to linux build tree
> >   make ARCH=x86_64
> >
> > All error/warnings:
> >
> >    Documentation/networking/timestamping/txtimestamp.c:113:8: warning: 'struct scm_timestamping' declared inside parameter list
> >            int tskey, int payload_len)
> >            ^
> >    Documentation/networking/timestamping/txtimestamp.c:113:8: warning: its scope is only this definition or declaration, which is probably not what you want
> >    Documentation/networking/timestamping/txtimestamp.c: In function 'print_timestamp':
> >>> Documentation/networking/timestamping/txtimestamp.c:118:7: error: 'SCM_TSTAMP_SCHED' undeclared (first use in this function)
> >      case SCM_TSTAMP_SCHED:
> >           ^
> >    Documentation/networking/timestamping/txtimestamp.c:118:7: note: each undeclared identifier is reported only once for each function it appears in
> >>> Documentation/networking/timestamping/txtimestamp.c:121:7: error: 'SCM_TSTAMP_SND' undeclared (first use in this function)
> >      case SCM_TSTAMP_SND:
> >           ^
> >>> Documentation/networking/timestamping/txtimestamp.c:124:7: error: 'SCM_TSTAMP_ACK' undeclared (first use in this function)
> >      case SCM_TSTAMP_ACK:
> >           ^
> >>> Documentation/networking/timestamping/txtimestamp.c:131:32: error: dereferencing pointer to incomplete type
> >      __print_timestamp(tsname, &tss->ts[0], tskey, payload_len);
> >                                    ^
> >    Documentation/networking/timestamping/txtimestamp.c: In function '__recv_errmsg_cmsg':
> >    Documentation/networking/timestamping/txtimestamp.c:177:19: warning: passing argument 1 of 'print_timestamp' from incompatible pointer type
> >       print_timestamp(tss, serr->ee_info, serr->ee_data, payload_len);
> >                       ^
> >    Documentation/networking/timestamping/txtimestamp.c:112:13: note: expected 'struct scm_timestamping *' but argument is of type 'struct scm_timestamping *'
> >     static void print_timestamp(struct scm_timestamping *tss, int tstype,
> >                 ^
> >    Documentation/networking/timestamping/txtimestamp.c: In function 'recv_errmsg':
> >    Documentation/networking/timestamping/txtimestamp.c:195:24: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
> >      memset(data, 0, sizeof(data));
> >                            ^
> >    Documentation/networking/timestamping/txtimestamp.c: In function 'do_test':
> >>> Documentation/networking/timestamping/txtimestamp.c:258:9: error: 'SOF_TIMESTAMPING_OPT_ID' undeclared (first use in this function)
> >             SOF_TIMESTAMPING_OPT_ID;
> >             ^
> >    Documentation/networking/timestamping/txtimestamp.c: In function 'do_main':
> >>> Documentation/networking/timestamping/txtimestamp.c:428:18: error: 'SOF_TIMESTAMPING_TX_SCHED' undeclared (first use in this function)
> >      do_test(family, SOF_TIMESTAMPING_TX_SCHED);
> >                      ^
> >>> Documentation/networking/timestamping/txtimestamp.c:436:19: error: 'SOF_TIMESTAMPING_TX_ACK' undeclared (first use in this function)
> >       do_test(family, SOF_TIMESTAMPING_TX_ACK);
> >                       ^
> > --
> >    Documentation/networking/timestamping/hwtstamp_config.c: In function 'main':
> >>> Documentation/networking/timestamping/hwtstamp_config.c:116:32: error: 'SIOCGHWTSTAMP' undeclared (first use in this function)
> >      if (ioctl(sock, (argc == 2) ? SIOCGHWTSTAMP : SIOCSHWTSTAMP, &ifr)) {
> >                                    ^
> >    Documentation/networking/timestamping/hwtstamp_config.c:116:32: note: each undeclared identifier is reported only once for each function it appears in
> > --
> >>> make[2]: *** No rule to make target 'Documentation/networking/timestamping//timestamping.c', needed by 'Documentation/networking/timestamping//timestamping'.
> >>> make[2]: *** No rule to make target 'Documentation/networking/timestamping//txtimestamp.c', needed by 'Documentation/networking/timestamping//txtimestamp'.
> >>> make[2]: *** No rule to make target 'Documentation/networking/timestamping//hwtstamp_config.c', needed by 'Documentation/networking/timestamping//hwtstamp_config'.
> >    make[2]: Target '__build' not remade because of errors.
> >
> > vim +/SCM_TSTAMP_SCHED +118 Documentation/networking/timestamping/txtimestamp.c
> >
> >    106          ts.tv_sec = tv.tv_sec;
> >    107          ts.tv_nsec = tv.tv_usec * 1000;
> >    108
> >    109          __print_timestamp("  USR", &ts, 0, 0);
> >    110  }
> >    111
> >  > 112  static void print_timestamp(struct scm_timestamping *tss, int tstype,
> >  > 113                              int tskey, int payload_len)
> >    114  {
> >    115          const char *tsname;
> >    116
> >    117          switch (tstype) {
> >  > 118          case SCM_TSTAMP_SCHED:
> >    119                  tsname = "  ENQ";
> >    120                  break;
> >  > 121          case SCM_TSTAMP_SND:
> >    122                  tsname = "  SND";
> >    123                  break;
> >  > 124          case SCM_TSTAMP_ACK:
> >    125                  tsname = "  ACK";
> >    126                  break;
> >    127          default:
> >    128                  error(1, 0, "unknown timestamp type: %u",
> >    129                  tstype);
> >    130          }
> >  > 131          __print_timestamp(tsname, &tss->ts[0], tskey, payload_len);
> >    132  }
> >    133
> >    134  static void __poll(int fd)
> >    135  {
> >    136          struct pollfd pollfd;
> >    137          int ret;
> >    138
> >    139          memset(&pollfd, 0, sizeof(pollfd));
> >    140          pollfd.fd = fd;
> >    141          ret = poll(&pollfd, 1, 100);
> >    142          if (ret != 1)
> >    143                  error(1, errno, "poll");
> >    144  }
> >    145
> >    146  static void __recv_errmsg_cmsg(struct msghdr *msg, int payload_len)
> >    147  {
> >    148          struct sock_extended_err *serr = NULL;
> >    149          struct scm_timestamping *tss = NULL;
> >    150          struct cmsghdr *cm;
> >    151
> >    152          for (cm = CMSG_FIRSTHDR(msg);
> >    153               cm && cm->cmsg_len;
> >    154               cm = CMSG_NXTHDR(msg, cm)) {
> >    155                  if (cm->cmsg_level == SOL_SOCKET &&
> >    156                      cm->cmsg_type == SCM_TIMESTAMPING) {
> >    157                          tss = (void *) CMSG_DATA(cm);
> >    158                  } else if ((cm->cmsg_level == SOL_IP &&
> >    159                       cm->cmsg_type == IP_RECVERR) ||
> >    160                      (cm->cmsg_level == SOL_IPV6 &&
> >    161                       cm->cmsg_type == IPV6_RECVERR)) {
> >    162
> >    163                          serr = (void *) CMSG_DATA(cm);
> >    164                          if (serr->ee_errno != ENOMSG ||
> >    165                              serr->ee_origin != SO_EE_ORIGIN_TIMESTAMPING) {
> >    166                                  fprintf(stderr, "unknown ip error %d %d\n",
> >    167                                                  serr->ee_errno,
> >    168                                                  serr->ee_origin);
> >    169                                  serr = NULL;
> >    170                          }
> >    171                  } else
> >    172                          fprintf(stderr, "unknown cmsg %d,%d\n",
> >    173                                          cm->cmsg_level, cm->cmsg_type);
> >    174          }
> >    175
> >    176          if (serr && tss)
> >    177                  print_timestamp(tss, serr->ee_info, serr->ee_data, payload_len);
> >    178  }
> >    179
> >    180  static int recv_errmsg(int fd)
> >    181  {
> >    182          static char ctrl[1024 /* overprovision*/];
> >    183          static struct msghdr msg;
> >    184          struct iovec entry;
> >    185          static char *data;
> >    186          int ret = 0;
> >    187
> >    188          data = malloc(cfg_payload_len);
> >    189          if (!data)
> >    190                  error(1, 0, "malloc");
> >    191
> >    192          memset(&msg, 0, sizeof(msg));
> >    193          memset(&entry, 0, sizeof(entry));
> >    194          memset(ctrl, 0, sizeof(ctrl));
> >  > 195          memset(data, 0, sizeof(data));
> >    196
> >    197          entry.iov_base = data;
> >    198          entry.iov_len = cfg_payload_len;
> >    199          msg.msg_iov = &entry;
> >    200          msg.msg_iovlen = 1;
> >    201          msg.msg_name = NULL;
> >    202          msg.msg_namelen = 0;
> >    203          msg.msg_control = ctrl;
> >    204          msg.msg_controllen = sizeof(ctrl);
> >    205
> >    206          ret = recvmsg(fd, &msg, MSG_ERRQUEUE);
> >    207          if (ret == -1 && errno != EAGAIN)
> >    208                  error(1, errno, "recvmsg");
> >    209
> >    210          __recv_errmsg_cmsg(&msg, ret);
> >    211
> >    212          free(data);
> >    213          return ret == -1;
> >    214  }
> >    215
> >    216  static void do_test(int family, unsigned int opt)
> >    217  {
> >    218          char *buf;
> >    219          int fd, i, val, total_len;
> >    220
> >    221          if (family == IPPROTO_IPV6 && cfg_proto != SOCK_STREAM) {
> >    222                  /* due to lack of checksum generation code */
> >    223                  fprintf(stderr, "test: skipping datagram over IPv6\n");
> >    224                  return;
> >    225          }
> >    226
> >    227          total_len = cfg_payload_len;
> >    228          if (cfg_proto == SOCK_RAW) {
> >    229                  total_len += sizeof(struct udphdr);
> >    230                  if (cfg_ipproto == IPPROTO_RAW)
> >    231                          total_len += sizeof(struct iphdr);
> >    232          }
> >    233
> >    234          buf = malloc(total_len);
> >    235          if (!buf)
> >    236                  error(1, 0, "malloc");
> >    237
> >    238          fd = socket(family, cfg_proto, cfg_ipproto);
> >    239          if (fd < 0)
> >    240                  error(1, errno, "socket");
> >    241
> >    242          if (cfg_proto == SOCK_STREAM) {
> >    243                  val = 1;
> >    244                  if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
> >    245                                 (char*) &val, sizeof(val)))
> >    246                          error(1, 0, "setsockopt no nagle");
> >    247
> >    248                  if (family == PF_INET) {
> >    249                          if (connect(fd, (void *) &daddr, sizeof(daddr)))
> >    250                                  error(1, errno, "connect ipv4");
> >    251                  } else {
> >    252                          if (connect(fd, (void *) &daddr6, sizeof(daddr6)))
> >    253                                  error(1, errno, "connect ipv6");
> >    254                  }
> >    255          }
> >    256
> >    257          opt |= SOF_TIMESTAMPING_SOFTWARE |
> >  > 258                 SOF_TIMESTAMPING_OPT_ID;
> >    259          if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING,
> >    260                         (char *) &opt, sizeof(opt)))
> >    261                  error(1, 0, "setsockopt timestamping");
> >
> > ---
> > 0-DAY kernel test infrastructure                Open Source Technology Center
> > http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux