netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: dst.h: Fix shifting signed 32-bit value by 31 bits problem
@ 2019-07-01 11:55 Vandana BN
  2019-07-01 17:49 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vandana BN @ 2019-07-01 11:55 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel
  Cc: skhan, gregkh, linux-kernel-mentees, Vandana BN

Fix DST_FEATURE_ECN_CA to use "U" cast to avoid shifting signed
32-bit value by 31 bits problem.

Signed-off-by: Vandana BN <bnvandana@gmail.com>
---
 include/net/dst.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/dst.h b/include/net/dst.h
index 12b31c602cb0..095c5daf9403 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -183,7 +183,7 @@ static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
 }

 /* Kernel-internal feature bits that are unallocated in user space. */
-#define DST_FEATURE_ECN_CA	(1 << 31)
+#define DST_FEATURE_ECN_CA	(1U << 31)

 #define DST_FEATURE_MASK	(DST_FEATURE_ECN_CA)
 #define DST_FEATURE_ECN_MASK	(DST_FEATURE_ECN_CA | RTAX_FEATURE_ECN)
--
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: dst.h: Fix shifting signed 32-bit value by 31 bits problem
  2019-07-01 11:55 [PATCH] net: dst.h: Fix shifting signed 32-bit value by 31 bits problem Vandana BN
@ 2019-07-01 17:49 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-07-01 17:49 UTC (permalink / raw)
  To: bnvandana; +Cc: netdev, linux-kernel, skhan, gregkh, linux-kernel-mentees

From: Vandana BN <bnvandana@gmail.com>
Date: Mon,  1 Jul 2019 17:25:39 +0530

> Fix DST_FEATURE_ECN_CA to use "U" cast to avoid shifting signed
> 32-bit value by 31 bits problem.
> 
> Signed-off-by: Vandana BN <bnvandana@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-01 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 11:55 [PATCH] net: dst.h: Fix shifting signed 32-bit value by 31 bits problem Vandana BN
2019-07-01 17:49 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).