diff mbox series

[net-next,v1,1/1] net/sched: cbs: Use units.h instead of the copy of a definition

Message ID 20231128174813.394462-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 000db9e9ad42e135c7d92a56a66116542ae2b6c3
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1,1/1] net/sched: cbs: Use units.h instead of the copy of a definition | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/codegen success Generated files up to date
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1115 this patch: 1115
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1142 this patch: 1142
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andy Shevchenko Nov. 28, 2023, 5:48 p.m. UTC
BYTES_PER_KBIT is defined in units.h, use that definition.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 net/sched/sch_cbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vinicius Costa Gomes Nov. 28, 2023, 8:22 p.m. UTC | #1
Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:

> BYTES_PER_KBIT is defined in units.h, use that definition.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Simon Horman Nov. 30, 2023, 9:03 p.m. UTC | #2
On Tue, Nov 28, 2023 at 07:48:13PM +0200, Andy Shevchenko wrote:
> BYTES_PER_KBIT is defined in units.h, use that definition.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

Did you consider a patch to update sja1105_main.c?
It also seems to have a copy of BYTES_PER_KBIT.
Simon Horman Nov. 30, 2023, 9:04 p.m. UTC | #3
On Thu, Nov 30, 2023 at 09:03:44PM +0000, Simon Horman wrote:
> On Tue, Nov 28, 2023 at 07:48:13PM +0200, Andy Shevchenko wrote:
> > BYTES_PER_KBIT is defined in units.h, use that definition.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Thanks, this looks good to me.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>
> 
> Did you consider a patch to update sja1105_main.c?
> It also seems to have a copy of BYTES_PER_KBIT.

I now see that you did :)
patchwork-bot+netdevbpf@kernel.org Dec. 1, 2023, 7:20 a.m. UTC | #4
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 28 Nov 2023 19:48:13 +0200 you wrote:
> BYTES_PER_KBIT is defined in units.h, use that definition.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  net/sched/sch_cbs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
  - [net-next,v1,1/1] net/sched: cbs: Use units.h instead of the copy of a definition
    https://git.kernel.org/netdev/net-next/c/000db9e9ad42

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c
index 9a0b85190a2c..beece8e82c23 100644
--- a/net/sched/sch_cbs.c
+++ b/net/sched/sch_cbs.c
@@ -57,6 +57,8 @@ 
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/skbuff.h>
+#include <linux/units.h>
+
 #include <net/netevent.h>
 #include <net/netlink.h>
 #include <net/sch_generic.h>
@@ -65,8 +67,6 @@ 
 static LIST_HEAD(cbs_list);
 static DEFINE_SPINLOCK(cbs_list_lock);
 
-#define BYTES_PER_KBIT (1000LL / 8)
-
 struct cbs_sched_data {
 	bool offload;
 	int queue;