* [PATCH] drivers: firmware: stratix10-rsu: Fix max_retry counter value
@ 2023-08-04 1:35 kah.jing.lee
2023-08-06 17:51 ` Dinh Nguyen
0 siblings, 1 reply; 3+ messages in thread
From: kah.jing.lee @ 2023-08-04 1:35 UTC (permalink / raw)
To: dinguyen; +Cc: linux-kernel, tien.sung.ang, Kah Jing Lee
From: Kah Jing Lee <kah.jing.lee@intel.com>
Fix the max_retry value because the value is truncated at scnprintf format
specifier, with added hex symbol and newline.
Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
---
drivers/firmware/stratix10-rsu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/firmware/stratix10-rsu.c b/drivers/firmware/stratix10-rsu.c
index e51c95f8d445..98ec39f6dae8 100644
--- a/drivers/firmware/stratix10-rsu.c
+++ b/drivers/firmware/stratix10-rsu.c
@@ -405,8 +405,7 @@ static ssize_t max_retry_show(struct device *dev,
if (!priv)
return -ENODEV;
- return scnprintf(buf, sizeof(priv->max_retry),
- "0x%08x\n", priv->max_retry);
+ return scnprintf(buf, PAGE_SIZE, "0x%08x\n", priv->max_retry);
}
static ssize_t dcmf0_show(struct device *dev,
base-commit: c1a515d3c0270628df8ae5f5118ba859b85464a2
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: firmware: stratix10-rsu: Fix max_retry counter value
2023-08-04 1:35 [PATCH] drivers: firmware: stratix10-rsu: Fix max_retry counter value kah.jing.lee
@ 2023-08-06 17:51 ` Dinh Nguyen
2023-08-18 1:56 ` Lee, Kah Jing
0 siblings, 1 reply; 3+ messages in thread
From: Dinh Nguyen @ 2023-08-06 17:51 UTC (permalink / raw)
To: kah.jing.lee; +Cc: linux-kernel, tien.sung.ang
On 8/3/23 20:35, kah.jing.lee@intel.com wrote:
> From: Kah Jing Lee <kah.jing.lee@intel.com>
>
> Fix the max_retry value because the value is truncated at scnprintf format
> specifier, with added hex symbol and newline.
>
> Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
> ---
> drivers/firmware/stratix10-rsu.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/stratix10-rsu.c b/drivers/firmware/stratix10-rsu.c
> index e51c95f8d445..98ec39f6dae8 100644
> --- a/drivers/firmware/stratix10-rsu.c
> +++ b/drivers/firmware/stratix10-rsu.c
> @@ -405,8 +405,7 @@ static ssize_t max_retry_show(struct device *dev,
> if (!priv)
> return -ENODEV;
>
> - return scnprintf(buf, sizeof(priv->max_retry),
> - "0x%08x\n", priv->max_retry);
> + return scnprintf(buf, PAGE_SIZE, "0x%08x\n", priv->max_retry);
> }
>
This would be a good time to switch over to use sysfs_emit()
Dinh
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] drivers: firmware: stratix10-rsu: Fix max_retry counter value
2023-08-06 17:51 ` Dinh Nguyen
@ 2023-08-18 1:56 ` Lee, Kah Jing
0 siblings, 0 replies; 3+ messages in thread
From: Lee, Kah Jing @ 2023-08-18 1:56 UTC (permalink / raw)
To: Dinh Nguyen; +Cc: linux-kernel, Ang, Tien Sung
> On 8/3/23 20:35, kah.jing.lee@intel.com wrote:
> > From: Kah Jing Lee <kah.jing.lee@intel.com>
> >
> > Fix the max_retry value because the value is truncated at scnprintf
> > format specifier, with added hex symbol and newline.
> >
> > Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
> > ---
> > drivers/firmware/stratix10-rsu.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/firmware/stratix10-rsu.c
> > b/drivers/firmware/stratix10-rsu.c
> > index e51c95f8d445..98ec39f6dae8 100644
> > --- a/drivers/firmware/stratix10-rsu.c
> > +++ b/drivers/firmware/stratix10-rsu.c
> > @@ -405,8 +405,7 @@ static ssize_t max_retry_show(struct device *dev,
> > if (!priv)
> > return -ENODEV;
> >
> > - return scnprintf(buf, sizeof(priv->max_retry),
> > - "0x%08x\n", priv->max_retry);
> > + return scnprintf(buf, PAGE_SIZE, "0x%08x\n", priv->max_retry);
> > }
> >
>
> This would be a good time to switch over to use sysfs_emit()
Let me update and send in v2.
Thanks.
>
> Dinh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-18 1:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04 1:35 [PATCH] drivers: firmware: stratix10-rsu: Fix max_retry counter value kah.jing.lee
2023-08-06 17:51 ` Dinh Nguyen
2023-08-18 1:56 ` Lee, Kah Jing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®