* [PATCH] ipmi: Remove uses of return value of seq_printf
@ 2015-02-17 19:10 Joe Perches
2015-02-18 17:56 ` Corey Minyard
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2015-02-17 19:10 UTC (permalink / raw)
To: Corey Minyard; +Cc: openipmi-developer, LKML
The seq_printf like functions will soon be changed to return void.
Convert these uses to check seq_has_overflowed instead.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/char/ipmi/ipmi_msghandler.c | 12 ++++++++----
drivers/char/ipmi/ipmi_si_intf.c | 26 +++++++++++++++-----------
drivers/char/ipmi/ipmi_ssif.c | 4 +++-
3 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index bf95efc..fa0b941 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -1997,7 +1997,9 @@ static int smi_ipmb_proc_show(struct seq_file *m, void *v)
seq_printf(m, "%x", intf->channels[0].address);
for (i = 1; i < IPMI_MAX_CHANNELS; i++)
seq_printf(m, " %x", intf->channels[i].address);
- return seq_putc(m, '\n');
+ seq_putc(m, '\n');
+
+ return seq_has_overflowed(m);
}
static int smi_ipmb_proc_open(struct inode *inode, struct file *file)
@@ -2016,9 +2018,11 @@ static int smi_version_proc_show(struct seq_file *m, void *v)
{
ipmi_smi_t intf = m->private;
- return seq_printf(m, "%u.%u\n",
- ipmi_version_major(&intf->bmc->id),
- ipmi_version_minor(&intf->bmc->id));
+ seq_printf(m, "%u.%u\n",
+ ipmi_version_major(&intf->bmc->id),
+ ipmi_version_minor(&intf->bmc->id));
+
+ return seq_has_overflowed(m);
}
static int smi_version_proc_open(struct inode *inode, struct file *file)
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index fd6110f..321ecb2 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2979,7 +2979,9 @@ static int smi_type_proc_show(struct seq_file *m, void *v)
{
struct smi_info *smi = m->private;
- return seq_printf(m, "%s\n", si_to_str[smi->si_type]);
+ seq_printf(m, "%s\n", si_to_str[smi->si_type]);
+
+ return seq_has_overflowed(m);
}
static int smi_type_proc_open(struct inode *inode, struct file *file)
@@ -3041,16 +3043,18 @@ static int smi_params_proc_show(struct seq_file *m, void *v)
{
struct smi_info *smi = m->private;
- return seq_printf(m,
- "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n",
- si_to_str[smi->si_type],
- addr_space_to_str[smi->io.addr_type],
- smi->io.addr_data,
- smi->io.regspacing,
- smi->io.regsize,
- smi->io.regshift,
- smi->irq,
- smi->slave_addr);
+ seq_printf(m,
+ "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n",
+ si_to_str[smi->si_type],
+ addr_space_to_str[smi->io.addr_type],
+ smi->io.addr_data,
+ smi->io.regspacing,
+ smi->io.regsize,
+ smi->io.regshift,
+ smi->irq,
+ smi->slave_addr);
+
+ return seq_has_overflowed(m);
}
static int smi_params_proc_open(struct inode *inode, struct file *file)
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 74128e6..f6e378d 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -1196,7 +1196,9 @@ static int ssif_detect(struct i2c_client *client, struct i2c_board_info *info)
static int smi_type_proc_show(struct seq_file *m, void *v)
{
- return seq_puts(m, "ssif\n");
+ seq_puts(m, "ssif\n");
+
+ return seq_has_overflowed(m);
}
static int smi_type_proc_open(struct inode *inode, struct file *file)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ipmi: Remove uses of return value of seq_printf
2015-02-17 19:10 [PATCH] ipmi: Remove uses of return value of seq_printf Joe Perches
@ 2015-02-18 17:56 ` Corey Minyard
2015-02-19 0:02 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Corey Minyard @ 2015-02-18 17:56 UTC (permalink / raw)
To: Joe Perches; +Cc: openipmi-developer, LKML
Thanks, queued for 3.20.
-corey
On 02/17/2015 01:10 PM, Joe Perches wrote:
> The seq_printf like functions will soon be changed to return void.
>
> Convert these uses to check seq_has_overflowed instead.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/char/ipmi/ipmi_msghandler.c | 12 ++++++++----
> drivers/char/ipmi/ipmi_si_intf.c | 26 +++++++++++++++-----------
> drivers/char/ipmi/ipmi_ssif.c | 4 +++-
> 3 files changed, 26 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
> index bf95efc..fa0b941 100644
> --- a/drivers/char/ipmi/ipmi_msghandler.c
> +++ b/drivers/char/ipmi/ipmi_msghandler.c
> @@ -1997,7 +1997,9 @@ static int smi_ipmb_proc_show(struct seq_file *m, void *v)
> seq_printf(m, "%x", intf->channels[0].address);
> for (i = 1; i < IPMI_MAX_CHANNELS; i++)
> seq_printf(m, " %x", intf->channels[i].address);
> - return seq_putc(m, '\n');
> + seq_putc(m, '\n');
> +
> + return seq_has_overflowed(m);
> }
>
> static int smi_ipmb_proc_open(struct inode *inode, struct file *file)
> @@ -2016,9 +2018,11 @@ static int smi_version_proc_show(struct seq_file *m, void *v)
> {
> ipmi_smi_t intf = m->private;
>
> - return seq_printf(m, "%u.%u\n",
> - ipmi_version_major(&intf->bmc->id),
> - ipmi_version_minor(&intf->bmc->id));
> + seq_printf(m, "%u.%u\n",
> + ipmi_version_major(&intf->bmc->id),
> + ipmi_version_minor(&intf->bmc->id));
> +
> + return seq_has_overflowed(m);
> }
>
> static int smi_version_proc_open(struct inode *inode, struct file *file)
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index fd6110f..321ecb2 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2979,7 +2979,9 @@ static int smi_type_proc_show(struct seq_file *m, void *v)
> {
> struct smi_info *smi = m->private;
>
> - return seq_printf(m, "%s\n", si_to_str[smi->si_type]);
> + seq_printf(m, "%s\n", si_to_str[smi->si_type]);
> +
> + return seq_has_overflowed(m);
> }
>
> static int smi_type_proc_open(struct inode *inode, struct file *file)
> @@ -3041,16 +3043,18 @@ static int smi_params_proc_show(struct seq_file *m, void *v)
> {
> struct smi_info *smi = m->private;
>
> - return seq_printf(m,
> - "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n",
> - si_to_str[smi->si_type],
> - addr_space_to_str[smi->io.addr_type],
> - smi->io.addr_data,
> - smi->io.regspacing,
> - smi->io.regsize,
> - smi->io.regshift,
> - smi->irq,
> - smi->slave_addr);
> + seq_printf(m,
> + "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n",
> + si_to_str[smi->si_type],
> + addr_space_to_str[smi->io.addr_type],
> + smi->io.addr_data,
> + smi->io.regspacing,
> + smi->io.regsize,
> + smi->io.regshift,
> + smi->irq,
> + smi->slave_addr);
> +
> + return seq_has_overflowed(m);
> }
>
> static int smi_params_proc_open(struct inode *inode, struct file *file)
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index 74128e6..f6e378d 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -1196,7 +1196,9 @@ static int ssif_detect(struct i2c_client *client, struct i2c_board_info *info)
>
> static int smi_type_proc_show(struct seq_file *m, void *v)
> {
> - return seq_puts(m, "ssif\n");
> + seq_puts(m, "ssif\n");
> +
> + return seq_has_overflowed(m);
> }
>
> static int smi_type_proc_open(struct inode *inode, struct file *file)
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ipmi: Remove uses of return value of seq_printf
2015-02-18 17:56 ` Corey Minyard
@ 2015-02-19 0:02 ` Joe Perches
2015-02-20 3:10 ` Corey Minyard
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2015-02-19 0:02 UTC (permalink / raw)
To: minyard; +Cc: openipmi-developer, LKML
On Wed, 2015-02-18 at 11:56 -0600, Corey Minyard wrote:
> Thanks, queued for 3.20.
Hey Corey, thanks, but I'll either have to send a new
patch or an updated patch changing these new
seq_has_overflowed() uses to 0.
There's no functional difference, but there is a logical
one. has_overflowed(), if it returns "true" (it won't here
because the first alloc seq_fs does has sufficient space)
would not retry and simply not emit anything.
Anyway, do you want a new patch or a relative patch?
sorry 'bout that, Joe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ipmi: Remove uses of return value of seq_printf
2015-02-19 0:02 ` Joe Perches
@ 2015-02-20 3:10 ` Corey Minyard
0 siblings, 0 replies; 4+ messages in thread
From: Corey Minyard @ 2015-02-20 3:10 UTC (permalink / raw)
To: Joe Perches; +Cc: openipmi-developer, LKML
Not a big deal, thanks for following up. Send a relative patch,
please. I already have this queued for upstream.
-corey
On 02/18/2015 06:02 PM, Joe Perches wrote:
> On Wed, 2015-02-18 at 11:56 -0600, Corey Minyard wrote:
>> Thanks, queued for 3.20.
> Hey Corey, thanks, but I'll either have to send a new
> patch or an updated patch changing these new
> seq_has_overflowed() uses to 0.
>
> There's no functional difference, but there is a logical
> one. has_overflowed(), if it returns "true" (it won't here
> because the first alloc seq_fs does has sufficient space)
> would not retry and simply not emit anything.
>
> Anyway, do you want a new patch or a relative patch?
>
> sorry 'bout that, Joe
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-20 3:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-17 19:10 [PATCH] ipmi: Remove uses of return value of seq_printf Joe Perches
2015-02-18 17:56 ` Corey Minyard
2015-02-19 0:02 ` Joe Perches
2015-02-20 3:10 ` Corey Minyard
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.