diff mbox series

caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16

Message ID af10f5a3236d47fd183487c9dcba3b3b3c66b595.1710584144.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16 | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
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: 943 this patch: 943
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 956 this patch: 956
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: 960 this patch: 960
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 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
netdev/contest success net-next-2024-03-19--18-00 (tests: 907)

Commit Message

Christophe JAILLET March 16, 2024, 10:16 a.m. UTC
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.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 net/caif/cfctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ratheesh Kannoth March 18, 2024, 3:21 a.m. UTC | #1
On 2024-03-16 at 15:46:10, Christophe JAILLET (christophe.jaillet@wanadoo.fr) 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.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  net/caif/cfctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
> index 8480684f2762..b6d9462f92b9 100644
> --- a/net/caif/cfctrl.c
> +++ b/net/caif/cfctrl.c
> @@ -206,7 +206,7 @@ int cfctrl_linkup_request(struct cflayer *layer,
>  	u8 tmp8;
>  	struct cfctrl_request_info *req;
>  	int ret;
> -	char utility_name[16];
> +	char utility_name[UTILITY_NAME_LENGTH];
Reverse xmas tree.

>  	struct cfpkt *pkt;
>  	struct cflayer *dn = cfctrl->serv.layer.dn;
>
> --
> 2.44.0
>
Dan Carpenter March 18, 2024, 8:05 a.m. UTC | #2
On Mon, Mar 18, 2024 at 08:51:33AM +0530, Ratheesh Kannoth wrote:
> On 2024-03-16 at 15:46:10, Christophe JAILLET (christophe.jaillet@wanadoo.fr) 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.
> >
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > ---
> >  net/caif/cfctrl.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
> > index 8480684f2762..b6d9462f92b9 100644
> > --- a/net/caif/cfctrl.c
> > +++ b/net/caif/cfctrl.c
> > @@ -206,7 +206,7 @@ int cfctrl_linkup_request(struct cflayer *layer,
> >  	u8 tmp8;
> >  	struct cfctrl_request_info *req;
> >  	int ret;
> > -	char utility_name[16];
> > +	char utility_name[UTILITY_NAME_LENGTH];
> Reverse xmas tree.
> 

It's always hard to know what to do when the original code isn't in the
correct format.  Someone sent a patch last week which fixed a bug and
partially converted a declaration block into reverse Christmas tree...

regards,
dan carpenter
Jiri Pirko March 18, 2024, 9:25 a.m. UTC | #3
Sat, Mar 16, 2024 at 11:16:10AM CET, christophe.jaillet@wanadoo.fr 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.
>
>Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

This is net-next material, yet net-next is closed.

https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle

pw-bot: defer
Christophe JAILLET March 18, 2024, 9:47 p.m. UTC | #4
Le 18/03/2024 à 04:21, Ratheesh Kannoth a écrit :
> On 2024-03-16 at 15:46:10, Christophe JAILLET (christophe.jaillet@wanadoo.fr) 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.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>   net/caif/cfctrl.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
>> index 8480684f2762..b6d9462f92b9 100644
>> --- a/net/caif/cfctrl.c
>> +++ b/net/caif/cfctrl.c
>> @@ -206,7 +206,7 @@ int cfctrl_linkup_request(struct cflayer *layer,
>>   	u8 tmp8;
>>   	struct cfctrl_request_info *req;
>>   	int ret;
>> -	char utility_name[16];
>> +	char utility_name[UTILITY_NAME_LENGTH];
> Reverse xmas tree.

Hi,

I'll update and repost when net-next is reopened, but honestly, looking 
at this file, changing this to reverse xmas style won't change that much 
for the overall coding style!

Moreover, as said by Dan, it is not really easy to understand the wishes 
of different maintainers. Should I have updated the lay-out, someone 
could have argued that patches should be 1 thing at a time.

CJ

> 
>>   	struct cfpkt *pkt;
>>   	struct cflayer *dn = cfctrl->serv.layer.dn;
>>
>> --
>> 2.44.0
>>
> 
>
diff mbox series

Patch

diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
index 8480684f2762..b6d9462f92b9 100644
--- a/net/caif/cfctrl.c
+++ b/net/caif/cfctrl.c
@@ -206,7 +206,7 @@  int cfctrl_linkup_request(struct cflayer *layer,
 	u8 tmp8;
 	struct cfctrl_request_info *req;
 	int ret;
-	char utility_name[16];
+	char utility_name[UTILITY_NAME_LENGTH];
 	struct cfpkt *pkt;
 	struct cflayer *dn = cfctrl->serv.layer.dn;