All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] ethtool: provide coalescing parameters with COALESCE_GET request
@ 2020-04-04 18:02 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-04-04 18:02 UTC (permalink / raw)
  To: kernel-janitors

Hello Michal Kubecek,

The patch 217275453b3e: "ethtool: provide coalescing parameters with
COALESCE_GET request" from Mar 28, 2020, leads to the following
static checker warning:

	net/ethtool/coalesce.c:134 coalesce_put_u32()
	warn: signedness bug returning '(-90)'

net/ethtool/coalesce.c
   129  static bool coalesce_put_u32(struct sk_buff *skb, u16 attr_type, u32 val,
   130                               u32 supported_params)
   131  {
   132          if (!val && !(supported_params & attr_to_mask(attr_type)))
   133                  return false;
   134          return nla_put_u32(skb, attr_type, val);

This is done deliberately to return true on failure and false on
success but it causes a static checker warning.

   135  }
   136  
   137  static bool coalesce_put_bool(struct sk_buff *skb, u16 attr_type, u32 val,
   138                                u32 supported_params)
   139  {
   140          if (!val && !(supported_params & attr_to_mask(attr_type)))
   141                  return false;
   142          return nla_put_u8(skb, attr_type, !!val);

Same.

   143  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-04 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-04 18:02 [bug report] ethtool: provide coalescing parameters with COALESCE_GET request Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.