netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16
@ 2024-03-30  8:32 Christophe JAILLET
  2024-03-30  8:32 ` Christophe JAILLET
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christophe JAILLET @ 2024-03-30  8:32 UTC (permalink / raw)
  To: rkannoth, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev

UTILITY_NAME_LENGTH is 16. So better use the former when defining the
'utility_name' array. This makes the intent clearer when it is used around
line 260.

While at it, declare variable in reverse xmas tree style.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Changes in v2:
  - Declare variable in reverse xmas tree style [Ratheesh Kannoth]

v1: https://lore.kernel.org/all/af10f5a3236d47fd183487c9dcba3b3b3c66b595.1710584144.git.christophe.jaillet@wanadoo.fr/
---
 net/caif/cfctrl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
index 8480684f2762..20139fa1be1f 100644
--- a/net/caif/cfctrl.c
+++ b/net/caif/cfctrl.c
@@ -201,14 +201,14 @@ int cfctrl_linkup_request(struct cflayer *layer,
 			  struct cflayer *user_layer)
 {
 	struct cfctrl *cfctrl = container_obj(layer);
+	struct cflayer *dn = cfctrl->serv.layer.dn;
+	char utility_name[UTILITY_NAME_LENGTH];
+	struct cfctrl_request_info *req;
+	struct cfpkt *pkt;
 	u32 tmp32;
 	u16 tmp16;
 	u8 tmp8;
-	struct cfctrl_request_info *req;
 	int ret;
-	char utility_name[16];
-	struct cfpkt *pkt;
-	struct cflayer *dn = cfctrl->serv.layer.dn;
 
 	if (!dn) {
 		pr_debug("not able to send linkup request\n");
-- 
2.44.0


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

* [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16
  2024-03-30  8:32 [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16 Christophe JAILLET
@ 2024-03-30  8:32 ` Christophe JAILLET
  2024-04-02  8:30 ` Simon Horman
  2024-04-03  1:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2024-03-30  8:32 UTC (permalink / raw)
  To: rkannoth, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev

UTILITY_NAME_LENGTH is 16. So better use the former when defining the
'utility_name' array. This makes the intent clearer when it is used around
line 260.

While at it, declare variable in reverse xmas tree style.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Changes in v2:
  - Declare variable in reverse xmas tree style [Ratheesh Kannoth]

v1: https://lore.kernel.org/all/af10f5a3236d47fd183487c9dcba3b3b3c66b595.1710584144.git.christophe.jaillet@wanadoo.fr/
---
 net/caif/cfctrl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
index 8480684f2762..20139fa1be1f 100644
--- a/net/caif/cfctrl.c
+++ b/net/caif/cfctrl.c
@@ -201,14 +201,14 @@ int cfctrl_linkup_request(struct cflayer *layer,
 			  struct cflayer *user_layer)
 {
 	struct cfctrl *cfctrl = container_obj(layer);
+	struct cflayer *dn = cfctrl->serv.layer.dn;
+	char utility_name[UTILITY_NAME_LENGTH];
+	struct cfctrl_request_info *req;
+	struct cfpkt *pkt;
 	u32 tmp32;
 	u16 tmp16;
 	u8 tmp8;
-	struct cfctrl_request_info *req;
 	int ret;
-	char utility_name[16];
-	struct cfpkt *pkt;
-	struct cflayer *dn = cfctrl->serv.layer.dn;
 
 	if (!dn) {
 		pr_debug("not able to send linkup request\n");
-- 
2.44.0



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

* Re: [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16
  2024-03-30  8:32 [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16 Christophe JAILLET
  2024-03-30  8:32 ` Christophe JAILLET
@ 2024-04-02  8:30 ` Simon Horman
  2024-04-03  1:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2024-04-02  8:30 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: rkannoth, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-kernel, kernel-janitors, netdev

On Sat, Mar 30, 2024 at 09:32:12AM +0100, Christophe JAILLET wrote:
> UTILITY_NAME_LENGTH is 16. So better use the former when defining the
> 'utility_name' array. This makes the intent clearer when it is used around
> line 260.
> 
> While at it, declare variable in reverse xmas tree style.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

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

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

* Re: [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16
  2024-03-30  8:32 [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16 Christophe JAILLET
  2024-03-30  8:32 ` Christophe JAILLET
  2024-04-02  8:30 ` Simon Horman
@ 2024-04-03  1:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-03  1:40 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: rkannoth, davem, edumazet, kuba, pabeni, linux-kernel,
	kernel-janitors, netdev

Hello:

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

On Sat, 30 Mar 2024 09:32:12 +0100 you wrote:
> UTILITY_NAME_LENGTH is 16. So better use the former when defining the
> 'utility_name' array. This makes the intent clearer when it is used around
> line 260.
> 
> While at it, declare variable in reverse xmas tree style.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16
    https://git.kernel.org/netdev/net-next/c/f9a4506438a1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-04-03  1:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-30  8:32 [PATCH net-next v2] caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16 Christophe JAILLET
2024-03-30  8:32 ` Christophe JAILLET
2024-04-02  8:30 ` Simon Horman
2024-04-03  1:40 ` patchwork-bot+netdevbpf

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).