[ovs-dev] [sparse 00/18] enable sparse checking for userspace

Ben Pfaff blp at nicira.com
Fri May 6 20:16:13 UTC 2011


This series starts out by fixing some minor bugs and code cleanliness
issues found with sparse:

  stream-ssl: Fix call to accept().
  ofproto: Fix ofproto_send_packet() treatment of vlan_tci parameter.
  Remove unnecessary #include directives.
  Add missing "static" keywords.
  ofproto: Drop duplicate "const" in parameter declaration.
  Consistently write null pointer constants as NULL instead of 0.

Then it cherry-picks a couple of patches from the "next" branch, which
are necessary to get endianness annotations right:

  ofproto: Maintain ofp_phy_port for each ofport in network byte order.
  Convert remaining network-byte-order "uint<N>_t"s into "ovs_be<N>"s.

Then a few more endianness annotation fixes that are not on "next":

  openflow: Change types from uint<N>_t to ovs_be<N>.
  Fix incorrect byte order annotations.

These patches quiet sparse warnings that seemed to individually
warrant commit messages:

  compiler: Suppress sparse complaints about function attributes.
  Suppress sparse warnings for global variables initialized in headers.
  util: Suppress build assertions when building with sparse.
  csum: Annotate byte order to match actual usage.
  Fix up usage of flow_wildcards_t.
  test-sha1: Suppress sparse warning.

The "big patch" is here:

  Make the source tree sparse clean.

Finally, enable "make C=1" to call sparse automatically for the
userspace build, just as it does for the kernel build:

  configure: Run sparse automatically if C=1 specified on "make"
    command.

 acinclude.m4                             |   35 +++++
 configure.ac                             |    1 +
 include/automake.mk                      |    1 +
 include/openflow/openflow.h              |  204 +++++++++++++++---------------
 include/openvswitch/types.h              |    1 -
 lib/csum.h => include/sparse/arpa/inet.h |   20 +---
 lib/csum.h => include/sparse/assert.h    |   21 +---
 include/sparse/automake.mk               |    8 ++
 include/sparse/math.h                    |  203 +++++++++++++++++++++++++++++
 include/sparse/netinet/in.h              |   95 ++++++++++++++
 include/sparse/netinet/ip6.h             |   61 +++++++++
 include/sparse/sys/socket.h              |  133 +++++++++++++++++++
 lib/csum.h => include/sparse/sys/wait.h  |   29 +++--
 lib/bond.c                               |    2 +-
 lib/byte-order.h                         |   51 +++++---
 lib/compiler.h                           |    4 +-
 lib/coverage.h                           |    4 +-
 lib/csum.c                               |   29 +++--
 lib/csum.h                               |   15 ++-
 lib/daemon.h                             |   12 +-
 lib/dhcp.h                               |   14 +-
 lib/dpif-linux.c                         |   10 +-
 lib/dpif-netdev.c                        |    8 +-
 lib/flow.c                               |    2 +-
 lib/flow.h                               |    2 +-
 lib/json.c                               |    3 +-
 lib/leak-checker.h                       |    6 +-
 lib/netdev-linux.c                       |    7 +-
 lib/netdev-provider.h                    |    3 +-
 lib/netdev-vport.c                       |    2 +-
 lib/netdev.c                             |    2 +-
 lib/netdev.h                             |    3 +-
 lib/nx-match.c                           |    2 +-
 lib/ofp-print.c                          |    4 +-
 lib/ofp-util.c                           |   44 +++----
 lib/ofp-util.h                           |    4 +-
 lib/packets.h                            |    4 +-
 lib/rconn.c                              |   12 +-
 lib/rconn.h                              |    9 +-
 lib/rtnetlink.c                          |    2 +-
 lib/sflow_receiver.c                     |    4 +
 lib/socket-util.c                        |    6 +-
 lib/socket-util.h                        |    3 +-
 lib/stream-ssl.c                         |    2 +-
 lib/stream-ssl.h                         |   10 +-
 lib/stress.h                             |    4 +-
 lib/table.h                              |   12 +-
 lib/unaligned.h                          |    7 +
 lib/util.h                               |    5 +-
 lib/vconn.h                              |    4 +-
 lib/vlog.h                               |    6 +-
 ofproto/connmgr.c                        |    5 +-
 ofproto/netflow.c                        |   42 +++---
 ofproto/ofproto-sflow.c                  |    2 +-
 ofproto/ofproto.c                        |   85 ++++++-------
 ofproto/ofproto.h                        |    2 +-
 ovsdb/execution.c                        |   12 +-
 ovsdb/jsonrpc-server.c                   |    4 +-
 ovsdb/log.c                              |    6 +-
 ovsdb/ovsdb-client.c                     |   10 +-
 ovsdb/ovsdb-server.c                     |   22 ++--
 ovsdb/ovsdb-tool.c                       |   10 +-
 ovsdb/ovsdb.c                            |    2 +-
 ovsdb/table.c                            |    2 +-
 tests/test-byte-order.c                  |    6 +-
 tests/test-csum.c                        |   43 ++++---
 tests/test-jsonrpc.c                     |    8 +-
 tests/test-lockfile.c                    |    4 +-
 tests/test-ovsdb.c                       |    8 +-
 tests/test-sha1.c                        |    7 +-
 tests/test-vconn.c                       |    6 +-
 utilities/ovs-appctl.c                   |    4 +-
 utilities/ovs-controller.c               |   28 ++--
 utilities/ovs-dpctl.c                    |   12 +-
 utilities/ovs-ofctl.c                    |   14 +-
 utilities/ovs-openflowd.c                |   54 ++++----
 utilities/ovs-vlan-bug-workaround.c      |    2 +-
 utilities/ovs-vsctl.c                    |   26 ++--
 vswitchd/ovs-brcompatd.c                 |   10 +-
 vswitchd/ovs-vswitchd.c                  |   14 +-
 80 files changed, 1068 insertions(+), 517 deletions(-)
 copy lib/csum.h => include/sparse/arpa/inet.h (51%)
 copy lib/csum.h => include/sparse/assert.h (51%)
 create mode 100644 include/sparse/automake.mk
 create mode 100644 include/sparse/math.h
 create mode 100644 include/sparse/netinet/in.h
 create mode 100644 include/sparse/netinet/ip6.h
 create mode 100644 include/sparse/sys/socket.h
 copy lib/csum.h => include/sparse/sys/wait.h (51%)

-- 
1.7.4.4




More information about the dev mailing list