[ovs-dev] [PATCH] ovsdb-data: Add OVS_WARN_UNUSED_RESULT annotations to function definitions.

Ben Pfaff blp at ovn.org
Fri Dec 8 21:40:45 UTC 2017


On Fri, Dec 08, 2017 at 01:37:29PM -0800, Gregory Rose wrote:
> On 12/8/2017 11:22 AM, Ben Pfaff wrote:
> >The function prototypes in ovsdb-data.h already have these, but it seems
> >more complete to have the annotation on the definitions too.
> >
> >Signed-off-by: Ben Pfaff <blp at ovn.org>
> >---
> >  lib/ovsdb-data.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
> >index 840e18fa1824..5d560fd98b24 100644
> >--- a/lib/ovsdb-data.c
> >+++ b/lib/ovsdb-data.c
> >@@ -1303,7 +1303,7 @@ ovsdb_datum_from_json__(struct ovsdb_datum *datum,
> >   * If 'symtab' is nonnull, then named UUIDs in 'symtab' are accepted.  Refer to
> >   * RFC 7047 for information about this, and for the syntax that this function
> >   * accepts. */
> >-struct ovsdb_error *
> >+struct ovsdb_error * OVS_WARN_UNUSED_RESULT
> >  ovsdb_datum_from_json(struct ovsdb_datum *datum,
> >                        const struct ovsdb_type *type,
> >                        const struct json *json,
> >@@ -1329,7 +1329,7 @@ ovsdb_datum_from_json(struct ovsdb_datum *datum,
> >   *
> >   * The datum generated should be used then discard. It is not suitable
> >   * for storing into IDL because of the possible member size violation.  */
> >-struct ovsdb_error *
> >+struct ovsdb_error * OVS_WARN_UNUSED_RESULT
> >  ovsdb_transient_datum_from_json(struct ovsdb_datum *datum,
> >                                  const struct ovsdb_type *type,
> >                                  const struct json *json)
> 
> Seems like a good idea.
> 
> Reviewed-by: Greg Rose <gvrose8192 at gmail.com>

Thanks for the review!  Applied to master.


More information about the dev mailing list