s390/net: updates 2023-06-10
Subsystems (4)
Alexandra Winter
maintainerv2 cover s390/net: updates 2023-06-10
Please apply the following patch series for s390's ctcm and lcs drivers to netdev's net-next tree.
Just maintenance patches, no functional changes.
Thanks,
Alexandra
v2:
- add Reviewed-by (1,3)
- improve commit message (2,4)
Thorsten Winkler (4):
s390/lcs: Convert sysfs sprintf to sysfs_emit s390/lcs: Convert sprintf to scnprintf s390/ctcm: Convert sysfs sprintf to sysfs_emit s390/ctcm: Convert sprintf/snprintf to scnprintf
drivers/s390/net/ctcm_dbug.c | 2 +- drivers/s390/net/ctcm_main.c | 6 ++--- drivers/s390/net/ctcm_main.h | 1 + drivers/s390/net/ctcm_mpc.c | 18 ++++++++------ drivers/s390/net/ctcm_sysfs.c | 46 +++++++++++++++++------------------ drivers/s390/net/lcs.c | 13 +++++----- drivers/s390/net/lcs.h | 2 +- 7 files changed, 46 insertions(+), 42 deletions(-)
Signature · 1 line
2.39.2
Alexandra Winter
maintainerPATCH v2 1/4 s390/lcs: Convert sysfs sprintf to sysfs_emit
From: Thorsten Winkler <[email protected]>
Following the advice of the Documentation/filesystems/sysfs.rst. All sysfs related show()-functions should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.
While at it, follow Linux kernel coding style and unify indentation
--- drivers/s390/net/lcs.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/s390/net/lcs.c +7 -6
@@ -1901,14 +1901,14 @@ lcs_open_device(struct net_device *dev)static ssize_t lcs_portno_show (struct device *dev,struct device_attribute *attr,char *buf) { -struct lcs_card *card; +struct lcs_card *card; card =dev_get_drvdata (dev); -if (!card) -return 0 ; +if (!card) +return 0 ; -return sprintf (buf,"%d\n" , card->portno); +return sysfs_emit (buf,"%d\n" , card->portno); }/*
@@ -1958,7 +1958,8 @@ lcs_type_show(struct device *dev, struct device_attribute *attr, char *buf)if (!cgdev)return -ENODEV ; -return sprintf (buf,"%s\n" , lcs_type[cgdev->cdev[0 ]->id.driver_info]); +return sysfs_emit (buf,"%s\n" , + lcs_type[cgdev->cdev[0 ]->id.driver_info]); } static DEVICE_ATTR(type, 0444, lcs_type_show, NULL);
@@ -1970,7 +1971,7 @@ lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf) card =dev_get_drvdata (dev); -return card ?sprintf (buf,"%u\n" , card->lancmd_timeout) :0 ; +return card ?sysfs_emit (buf,"%u\n" , card->lancmd_timeout) :0 ; } static ssize_t
Signature · 1 line
2.39.2
Re: [PATCH net-next v2 1/4] s390/lcs: Convert sysfs sprintf to sysfs_emit
Quoted 7 lines · Alexandra Winter
From: Thorsten Winkler <[email protected]>
Following the advice of the
Documentation/filesystems/sysfs.rst. All sysfs related show()-functions should only usesysfs_emit()orsysfs_emit_at()when formatting the value to be returned to user space.While at it, follow Linux kernel coding style and unify indentation
[]
drivers/s390/net/lcs.c
Quoted 1 line
drivers/s390/net/lcs.c +0
-0
[]
Quoted 6 lines
drivers/s390/net/lcs.c +1
-1@@ -1901,14 +1901,14 @@ lcs_open_device(struct net_device *dev)static ssize_t lcs_portno_show (struct device *dev,struct device_attribute *attr,char *buf) { -struct lcs_card *card; +struct lcs_card *card;
drivers/s390/net/lcs.c lcs_open_device(struct net_device *dev) · line 1911
Quoted 10 lines
drivers/s390/net/lcs.c +3
-3card =dev_get_drvdata (dev); -if (!card) -return 0 ; +if (!card) +return 0 ; -return sprintf (buf,"%d\n" , card->portno); +return sysfs_emit (buf,"%d\n" , card->portno);
[]
drivers/s390/net/lcs.c lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf) · line 1974
Quoted 6 lines
drivers/s390/net/lcs.c +1
-1@@ -1970,7 +1971,7 @@ lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf) card =dev_get_drvdata (dev); -return card ?sprintf (buf,"%u\n" , card->lancmd_timeout) :0 ; +return card ?sysfs_emit (buf,"%u\n" , card->lancmd_timeout) :0 ;
Like the other show function
I think it'd be nicer to use:
card = dev_get_drvdata(dev); if (!card) return 0; return sysfs_emit(buf, "%u\n", card->lancmd_timeout);
Alexandra Winter
maintainerPATCH v2 2/4 s390/lcs: Convert sprintf to scnprintf
In reply to Alexandra WinterFrom: Thorsten Winkler <[email protected]>
This LWN article explains the why scnprintf is preferred over snprintf in general
https://lwn.net/Articles/69419/
Ie. snprintf() returns what *would* be the resulting length, while scnprintf() returns the actual length.
--- drivers/s390/net/lcs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/lcs.h +1 -1
@@ -21,7 +21,7 @@ do { \ #define LCS_DBF_TEXT_(level,name,text...) \ do { \ if (debug_level_enabled(lcs_dbf_##name, level)) { \ - sprintf(debug_buffer, text); \ + scnprintf(debug_buffer, sizeof(debug_buffer), text); \ debug_text_event(lcs_dbf_##name, level, debug_buffer); \ } \ } while (0)
Signature · 1 line
2.39.2
Alexandra Winter
maintainerPATCH v2 3/4 s390/ctcm: Convert sysfs sprintf to sysfs_emit
In reply to Alexandra WinterFrom: Thorsten Winkler <[email protected]>
Following the advice of the Documentation/filesystems/sysfs.rst. All sysfs related show()-functions should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.
--- drivers/s390/net/ctcm_sysfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/s390/net/ctcm_sysfs.c +5 -5
@@ -28,7 +28,7 @@ static ssize_t ctcm_buffer_show(struct device *dev,if (!priv)return -ENODEV ; -return sprintf (buf,"%d\n" , priv->buffer_size); +return sysfs_emit (buf,"%d\n" , priv->buffer_size); } static ssize_t ctcm_buffer_write(struct device *dev,
@@ -120,7 +120,7 @@ static ssize_t stats_show(struct device *dev,if (!priv || gdev->state !=CCWGROUP_ONLINE )return -ENODEV ;ctcm_print_statistics (priv); -return sprintf (buf,"0\n" ); +return sysfs_emit (buf,"0\n" ); } static ssize_t stats_write(struct device *dev, struct device_attribute *attr,
@@ -142,7 +142,7 @@ static ssize_t ctcm_proto_show(struct device *dev,if (!priv)return -ENODEV ; -return sprintf (buf,"%d\n" , priv->protocol); +return sysfs_emit (buf,"%d\n" , priv->protocol); } static ssize_t ctcm_proto_store(struct device *dev,
@@ -184,8 +184,8 @@ static ssize_t ctcm_type_show(struct device *dev,if (!cgdev)return -ENODEV ; -return sprintf (buf,"%s\n" , - ctcm_type[cgdev->cdev[0 ]->id.driver_info]); +return sysfs_emit (buf,"%s\n" , + ctcm_type[cgdev->cdev[0 ]->id.driver_info]); } static DEVICE_ATTR(buffer, 0644, ctcm_buffer_show, ctcm_buffer_write);
Signature · 1 line
2.39.2
Alexandra Winter
maintainerPATCH v2 4/4 s390/ctcm: Convert sprintf/snprintf to scnprintf
In reply to Alexandra WinterFrom: Thorsten Winkler <[email protected]>
This LWN article explains the why scnprintf is preferred over snprintf in general
https://lwn.net/Articles/69419/
Ie. snprintf() returns what *would* be the resulting length, while scnprintf() returns the actual length.
Note that ctcm_print_statistics() writes the data into the kernel log and is therefore not suitable for sysfs_emit(). Observable behavior is not changed, as there may be dependencies.
--- drivers/s390/net/ctcm_dbug.c | 2 +- drivers/s390/net/ctcm_main.c | 6 +++--- drivers/s390/net/ctcm_main.h | 1 + drivers/s390/net/ctcm_mpc.c | 18 ++++++++++-------- drivers/s390/net/ctcm_sysfs.c | 36 +++++++++++++++++------------------ 5 files changed, 33 insertions(+), 30 deletions(-)
drivers/s390/net/ctcm_dbug.c +1 -1
@@ -70,7 +70,7 @@ void ctcm_dbf_longtext(enum ctcm_dbf_names dbf_nix, int level, char *fmt, ...)if (!debug_level_enabled (ctcm_dbf[dbf_nix].id, level))return ;va_start (args, fmt); -vsnprintf (dbf_txt_buf,sizeof (dbf_txt_buf), fmt, args); +vscnprintf (dbf_txt_buf,sizeof (dbf_txt_buf), fmt, args);va_end (args);debug_text_event (ctcm_dbf[dbf_nix].id, level, dbf_txt_buf);
drivers/s390/net/ctcm_main.c +3 -3
@@ -1340,7 +1340,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, goto nomem_return; ch->cdev = cdev; -snprintf (ch->id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev->dev)); +scnprintf (ch->id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev->dev)); ch->type = type;/*
@@ -1505,8 +1505,8 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) type =get_channel_type (&cdev0->id); -snprintf (read_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev0->dev)); -snprintf (write_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev1->dev)); +scnprintf (read_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev0->dev)); +scnprintf (write_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev1->dev)); ret =add_channel (cdev0, type, priv);if (ret) {
drivers/s390/net/ctcm_main.h +1 -0
@@ -100,6 +100,7 @@ enum ctcm_channel_types {#define CTCM_PROTO_MPC 4#define CTCM_PROTO_MAX 4 +#define CTCM_STATSIZE_LIMIT 64#define CTCM_BUFSIZE_LIMIT 65535#define CTCM_BUFSIZE_DEFAULT 32768#define MPC_BUFSIZE_DEFAULT CTCM_BUFSIZE_LIMIT
drivers/s390/net/ctcm_mpc.c +10 -8
@@ -144,9 +144,9 @@ void ctcmpc_dumpit(char *buf, int len)for (ct =0 ; ct < len; ct++, ptr++, rptr++) {if (sw ==0 ) { -sprintf (addr,"%16.16llx" , (__u64 )rptr); +scnprintf (addr,sizeof (addr),"%16.16llx" , (__u64 )rptr); -sprintf (boff,"%4.4X" , (__u32 )ct); +scnprintf (boff,sizeof (boff),"%4.4X" , (__u32 )ct); bhex[0 ] ='\0' ; basc[0 ] ='\0' ; }
@@ -155,7 +155,7 @@ void ctcmpc_dumpit(char *buf, int len)if (sw ==8 )strcat (bhex," " ); -sprintf (tbuf,"%2.2llX" , (__u64)*ptr); +scnprintf (tbuf,sizeof (tbuf),"%2.2llX" , (__u64)*ptr); tbuf[2 ] ='\0' ;strcat (bhex, tbuf);
@@ -171,8 +171,8 @@ void ctcmpc_dumpit(char *buf, int len)continue ;if ((strcmp (duphex, bhex)) !=0 ) {if (dup !=0 ) { -sprintf (tdup, -"Duplicate as above to %s" , addr); +scnprintf (tdup,sizeof (tdup), +"Duplicate as above to %s" , addr);ctcm_pr_debug (" --- %s ---\n" , tdup); }
@@ -197,14 +197,16 @@ void ctcmpc_dumpit(char *buf, int len)strcat (basc," " ); }if (dup !=0 ) { -sprintf (tdup,"Duplicate as above to %s" , addr); +scnprintf (tdup,sizeof (tdup), +"Duplicate as above to %s" , addr);ctcm_pr_debug (" --- %s ---\n" , tdup); }ctcm_pr_debug (" %s (+%s) : %s [%s]\n" , addr, boff, bhex, basc); }else {if (dup >=1 ) { -sprintf (tdup,"Duplicate as above to %s" , addr); +scnprintf (tdup,sizeof (tdup), +"Duplicate as above to %s" , addr);ctcm_pr_debug (" --- %s ---\n" , tdup); }if (dup !=0 ) {
@@ -291,7 +293,7 @@ static struct net_device *ctcmpc_get_dev(int port_num)struct net_device *dev;struct ctcm_priv *priv; -sprintf (device,"%s%i" ,MPC_DEVICE_NAME , port_num); +scnprintf (device,sizeof (device),"%s%i" ,MPC_DEVICE_NAME , port_num); dev =__dev_get_by_name (&init_net, device);
drivers/s390/net/ctcm_sysfs.c +18 -18
@@ -86,24 +86,24 @@ static void ctcm_print_statistics(struct ctcm_priv *priv)return ; p = sbuf; - p +=sprintf (p," Device FSM state: %s\n" , -fsm_getstate_str (priv->fsm)); - p +=sprintf (p," RX channel FSM state: %s\n" , -fsm_getstate_str (priv->channel[CTCM_READ ]->fsm)); - p +=sprintf (p," TX channel FSM state: %s\n" , -fsm_getstate_str (priv->channel[CTCM_WRITE ]->fsm)); - p +=sprintf (p," Max. TX buffer used: %ld\n" , - priv->channel[WRITE ]->prof.maxmulti); - p +=sprintf (p," Max. chained SKBs: %ld\n" , - priv->channel[WRITE ]->prof.maxcqueue); - p +=sprintf (p," TX single write ops: %ld\n" , - priv->channel[WRITE ]->prof.doios_single); - p +=sprintf (p," TX multi write ops: %ld\n" , - priv->channel[WRITE ]->prof.doios_multi); - p +=sprintf (p," Netto bytes written: %ld\n" , - priv->channel[WRITE ]->prof.txlen); - p +=sprintf (p," Max. TX IO-time: %u\n" , -jiffies_to_usecs (priv->channel[WRITE ]->prof.tx_time)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Device FSM state: %s\n" , +fsm_getstate_str (priv->fsm)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," RX channel FSM state: %s\n" , +fsm_getstate_str (priv->channel[CTCM_READ ]->fsm)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," TX channel FSM state: %s\n" , +fsm_getstate_str (priv->channel[CTCM_WRITE ]->fsm)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Max. TX buffer used: %ld\n" , + priv->channel[WRITE ]->prof.maxmulti); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Max. chained SKBs: %ld\n" , + priv->channel[WRITE ]->prof.maxcqueue); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," TX single write ops: %ld\n" , + priv->channel[WRITE ]->prof.doios_single); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," TX multi write ops: %ld\n" , + priv->channel[WRITE ]->prof.doios_multi); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Netto bytes written: %ld\n" , + priv->channel[WRITE ]->prof.txlen); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Max. TX IO-time: %u\n" , +jiffies_to_usecs (priv->channel[WRITE ]->prof.tx_time));printk (KERN_INFO "Statistics for %s:\n%s" , priv->channel[CTCM_WRITE ]->netdev->name, sbuf);
Signature · 1 line
2.39.2
Paolo Abeni
maintainerRe: [PATCH net-next v2 4/4] s390/ctcm: Convert sprintf/snprintf to scnprintf
Quoted 173 lines · Alexandra Winter
From: Thorsten Winkler <[email protected]>
This LWN article explains the why scnprintf is preferred over snprintf in general
https://lwn.net/Articles/69419/
Ie.snprintf()returns what *would* be the resulting length, whilescnprintf()returns the actual length.Note that
ctcm_print_statistics()writes the data into the kernel log and is therefore not suitable forsysfs_emit(). Observable behavior is not changed, as there may be dependencies.Reviewed-by Alexandra Winter <[email protected]>Signed-off-by Thorsten Winkler <[email protected]>Signed-off-by Alexandra Winter <[email protected]>--- drivers/s390/net/ctcm_dbug.c | 2 +- drivers/s390/net/ctcm_main.c | 6 +++--- drivers/s390/net/ctcm_main.h | 1 + drivers/s390/net/ctcm_mpc.c | 18 ++++++++++-------- drivers/s390/net/ctcm_sysfs.c | 36 +++++++++++++++++------------------ 5 files changed, 33 insertions(+), 30 deletions(-)drivers/s390/net/ctcm_dbug.c +1
-1@@ -70,7 +70,7 @@ void ctcm_dbf_longtext(enum ctcm_dbf_names dbf_nix, int level, char *fmt, ...)if (!debug_level_enabled (ctcm_dbf[dbf_nix].id, level))return ;va_start (args, fmt); -vsnprintf (dbf_txt_buf,sizeof (dbf_txt_buf), fmt, args); +vscnprintf (dbf_txt_buf,sizeof (dbf_txt_buf), fmt, args);va_end (args);debug_text_event (ctcm_dbf[dbf_nix].id, level, dbf_txt_buf);drivers/s390/net/ctcm_main.c +3
-3@@ -1340,7 +1340,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, goto nomem_return; ch->cdev = cdev; -snprintf (ch->id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev->dev)); +scnprintf (ch->id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev->dev)); ch->type = type;/* @@ -1505,8 +1505,8 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) type =get_channel_type (&cdev0->id); -snprintf (read_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev0->dev)); -snprintf (write_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev1->dev)); +scnprintf (read_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev0->dev)); +scnprintf (write_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev1->dev)); ret =add_channel (cdev0, type, priv);if (ret) {drivers/s390/net/ctcm_main.h +1
-0@@ -100,6 +100,7 @@ enum ctcm_channel_types {#define CTCM_PROTO_MPC 4#define CTCM_PROTO_MAX 4 +#define CTCM_STATSIZE_LIMIT 64#define CTCM_BUFSIZE_LIMIT 65535#define CTCM_BUFSIZE_DEFAULT 32768#define MPC_BUFSIZE_DEFAULT CTCM_BUFSIZE_LIMITdrivers/s390/net/ctcm_mpc.c +10
-8@@ -144,9 +144,9 @@ void ctcmpc_dumpit(char *buf, int len)for (ct =0 ; ct < len; ct++, ptr++, rptr++) {if (sw ==0 ) { -sprintf (addr,"%16.16llx" , (__u64 )rptr); +scnprintf (addr,sizeof (addr),"%16.16llx" , (__u64 )rptr); -sprintf (boff,"%4.4X" , (__u32 )ct); +scnprintf (boff,sizeof (boff),"%4.4X" , (__u32 )ct); bhex[0 ] ='\0' ; basc[0 ] ='\0' ; }@@ -155,7 +155,7 @@ void ctcmpc_dumpit(char *buf, int len)if (sw ==8 )strcat (bhex," " ); -sprintf (tbuf,"%2.2llX" , (__u64)*ptr); +scnprintf (tbuf,sizeof (tbuf),"%2.2llX" , (__u64)*ptr); tbuf[2 ] ='\0' ;strcat (bhex, tbuf);@@ -171,8 +171,8 @@ void ctcmpc_dumpit(char *buf, int len)continue ;if ((strcmp (duphex, bhex)) !=0 ) {if (dup !=0 ) { -sprintf (tdup, -"Duplicate as above to %s" , addr); +scnprintf (tdup,sizeof (tdup), +"Duplicate as above to %s" , addr);ctcm_pr_debug (" --- %s ---\n" , tdup); }@@ -197,14 +197,16 @@ void ctcmpc_dumpit(char *buf, int len)strcat (basc," " ); }if (dup !=0 ) { -sprintf (tdup,"Duplicate as above to %s" , addr); +scnprintf (tdup,sizeof (tdup), +"Duplicate as above to %s" , addr);ctcm_pr_debug (" --- %s ---\n" , tdup); }ctcm_pr_debug (" %s (+%s) : %s [%s]\n" , addr, boff, bhex, basc); }else {if (dup >=1 ) { -sprintf (tdup,"Duplicate as above to %s" , addr); +scnprintf (tdup,sizeof (tdup), +"Duplicate as above to %s" , addr);ctcm_pr_debug (" --- %s ---\n" , tdup); }if (dup !=0 ) {@@ -291,7 +293,7 @@ static struct net_device *ctcmpc_get_dev(int port_num)struct net_device *dev;struct ctcm_priv *priv; -sprintf (device,"%s%i" ,MPC_DEVICE_NAME , port_num); +scnprintf (device,sizeof (device),"%s%i" ,MPC_DEVICE_NAME , port_num); dev =__dev_get_by_name (&init_net, device);drivers/s390/net/ctcm_sysfs.c +11
-18@@ -86,24 +86,24 @@ static void ctcm_print_statistics(struct ctcm_priv *priv)return ; p = sbuf; - p +=sprintf (p," Device FSM state: %s\n" , -fsm_getstate_str (priv->fsm)); - p +=sprintf (p," RX channel FSM state: %s\n" , -fsm_getstate_str (priv->channel[CTCM_READ ]->fsm)); - p +=sprintf (p," TX channel FSM state: %s\n" , -fsm_getstate_str (priv->channel[CTCM_WRITE ]->fsm)); - p +=sprintf (p," Max. TX buffer used: %ld\n" , - priv->channel[WRITE ]->prof.maxmulti); - p +=sprintf (p," Max. chained SKBs: %ld\n" , - priv->channel[WRITE ]->prof.maxcqueue); - p +=sprintf (p," TX single write ops: %ld\n" , - priv->channel[WRITE ]->prof.doios_single); - p +=sprintf (p," TX multi write ops: %ld\n" , - priv->channel[WRITE ]->prof.doios_multi); - p +=sprintf (p," Netto bytes written: %ld\n" , - priv->channel[WRITE ]->prof.txlen); - p +=sprintf (p," Max. TX IO-time: %u\n" , -jiffies_to_usecs (priv->channel[WRITE ]->prof.tx_time)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Device FSM state: %s\n" , +fsm_getstate_str (priv->fsm)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," RX channel FSM state: %s\n" , +fsm_getstate_str (priv->channel[CTCM_READ ]->fsm)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," TX channel FSM state: %s\n" , +fsm_getstate_str (priv->channel[CTCM_WRITE ]->fsm)); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Max. TX buffer used: %ld\n" , + priv->channel[WRITE ]->prof.maxmulti); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Max. chained SKBs: %ld\n" , + priv->channel[WRITE ]->prof.maxcqueue); + p += scnprintf(p, CTCM_STATSIZE_LIMIT, " TX single write ops: %ld\n",
drivers/s390/net/ctcm_sysfs.c static void ctcm_print_statistics(struct ctcm_priv *priv) · line 109
Quoted 10 lines
drivers/s390/net/ctcm_sysfs.c +7
-0+ priv->channel[WRITE]->prof.doios_single); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," TX multi write ops: %ld\n" , + priv->channel[WRITE ]->prof.doios_multi); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Netto bytes written: %ld\n" , + priv->channel[WRITE ]->prof.txlen); + p +=scnprintf (p,CTCM_STATSIZE_LIMIT ," Max. TX IO-time: %u\n" , +jiffies_to_usecs (priv->channel[WRITE ]->prof.tx_time));printk (KERN_INFO "Statistics for %s:\n%s" , priv->channel[CTCM_WRITE ]->netdev->name, sbuf);
Not strictly related to this series, but it looks like there is opportunity for more cleanups? e.g. move legacy printk to pr_info(), etc...
The series LGTM.
Thanks,
Paolo
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 9 lines · On Wed, 21 Jun 2023 15:49:17 +0200 you wrote:
Please apply the following patch series for s390's ctcm and lcs drivers to netdev's net-next tree.
Just maintenance patches, no functional changes.
Thanks,
Alexandra[...]
Here is the summary with links:
- [net-next,v2,1/4] s390/lcs: Convert sysfs sprintf to sysfs_emit
https://git.kernel.org/netdev/net-next/c/d3f0c7fa0993 - [net-next,v2,2/4] s390/lcs: Convert sprintf to scnprintf https://git.kernel.org/netdev/net-next/c/1a079f3e9529 - [net-next,v2,3/4] s390/ctcm: Convert sysfs sprintf to sysfs_emit https://git.kernel.org/netdev/net-next/c/d585e4b74806 - [net-next,v2,4/4] s390/ctcm: Convert sprintf/snprintf to scnprintf https://git.kernel.org/netdev/net-next/c/1471d85ffba7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html