All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] openvswitch: meter: Remove unnecessary int
@ 2022-04-18  0:50 Solomon Tan
  2022-04-21  8:47 ` Paolo Abeni
  0 siblings, 1 reply; 2+ messages in thread
From: Solomon Tan @ 2022-04-18  0:50 UTC (permalink / raw)
  To: pshelar, davem, kuba, pabeni, netdev, dev, linux-kernel

This patch addresses the checkpatch.pl warning that long long is
preferred over long long int.

Signed-off-by: Solomon Tan <solomonbstoner@protonmail.ch>
---
 net/openvswitch/meter.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index 04a060ac7fdf..a790920c11d6 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -592,8 +592,8 @@ static int ovs_meter_cmd_del(struct sk_buff *skb, struct genl_info *info)
 bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,
 		       struct sw_flow_key *key, u32 meter_id)
 {
-	long long int now_ms = div_u64(ktime_get_ns(), 1000 * 1000);
-	long long int long_delta_ms;
+	long long now_ms = div_u64(ktime_get_ns(), 1000 * 1000);
+	long long long_delta_ms;
 	struct dp_meter_band *band;
 	struct dp_meter *meter;
 	int i, band_exceeded_max = -1;
@@ -622,7 +622,7 @@ bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,
 	/* Make sure delta_ms will not be too large, so that bucket will not
 	 * wrap around below.
 	 */
-	delta_ms = (long_delta_ms > (long long int)meter->max_delta_t)
+	delta_ms = (long_delta_ms > (long long)meter->max_delta_t)
 		   ? meter->max_delta_t : (u32)long_delta_ms;

 	/* Update meter statistics.
@@ -645,7 +645,7 @@ bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,

 	/* Update all bands and find the one hit with the highest rate. */
 	for (i = 0; i < meter->n_bands; ++i) {
-		long long int max_bucket_size;
+		long long max_bucket_size;

 		band = &meter->bands[i];
 		max_bucket_size = band->burst_size * 1000LL;
--
2.35.3



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

* Re: [PATCH] openvswitch: meter: Remove unnecessary int
  2022-04-18  0:50 [PATCH] openvswitch: meter: Remove unnecessary int Solomon Tan
@ 2022-04-21  8:47 ` Paolo Abeni
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2022-04-21  8:47 UTC (permalink / raw)
  To: Solomon Tan, pshelar, davem, kuba, netdev, dev, linux-kernel

On Mon, 2022-04-18 at 00:50 +0000, Solomon Tan wrote:
> This patch addresses the checkpatch.pl warning that long long is
> preferred over long long int.

Please don't do that. This kind of changes cause e.g. backporting issue
for any later relevant bugfix touching the same area, for no real
benefit. 

Documentation/process/2.Process.rst

explicltly states to avoid this kind of patches.
> 
> Signed-off-by: Solomon Tan <solomonbstoner@protonmail.ch>
> ---
>  net/openvswitch/meter.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
> index 04a060ac7fdf..a790920c11d6 100644
> --- a/net/openvswitch/meter.c
> +++ b/net/openvswitch/meter.c
> @@ -592,8 +592,8 @@ static int ovs_meter_cmd_del(struct sk_buff *skb, struct genl_info *info)
>  bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,
>  		       struct sw_flow_key *key, u32 meter_id)
>  {
> -	long long int now_ms = div_u64(ktime_get_ns(), 1000 * 1000);
> -	long long int long_delta_ms;
> +	long long now_ms = div_u64(ktime_get_ns(), 1000 * 1000);
> +	long long long_delta_ms;
>  	struct dp_meter_band *band;
>  	struct dp_meter *meter;
>  	int i, band_exceeded_max = -1;

Additionally the patch is mangled by non plain-text encoding.

For any later submissions (regarding some other different topic) please
ensure that your client/mailer send purely plain-text messages,

Thanks,

Paolo


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

end of thread, other threads:[~2022-04-21  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18  0:50 [PATCH] openvswitch: meter: Remove unnecessary int Solomon Tan
2022-04-21  8:47 ` Paolo Abeni

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.