2014-11-04 16:02:45

by Steven Rostedt

[permalink] [raw]
Subject: [RFC][PATCH 02/12 v3] RAS/tracing: Use trace_seq_buffer_ptr() helper instead of open coded

From: "Steven Rostedt (Red Hat)" <[email protected]>

Use the helper function trace_seq_buffer_ptr() to get the current location
of the next buffer write of a trace_seq object, instead of open coding
it.

This facilitates the conversion of trace_seq to use seq_buf.

Cc: Chen Gong <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Tony Luck <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
---
drivers/firmware/efi/cper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index 5b53d6183b6b..4fd9961d552e 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -294,7 +294,7 @@ void cper_mem_err_pack(const struct cper_sec_mem_err *mem,
const char *cper_mem_err_unpack(struct trace_seq *p,
struct cper_mem_err_compact *cmem)
{
- const char *ret = p->buffer + p->len;
+ const char *ret = trace_seq_buffer_ptr(p);

if (cper_mem_err_location(cmem, rcd_decode_str))
trace_seq_printf(p, "%s", rcd_decode_str);
--
2.1.1


2014-11-04 20:00:09

by Borislav Petkov

[permalink] [raw]
Subject: Re: [RFC][PATCH 02/12 v3] RAS/tracing: Use trace_seq_buffer_ptr() helper instead of open coded

On Tue, Nov 04, 2014 at 10:52:39AM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <[email protected]>
>
> Use the helper function trace_seq_buffer_ptr() to get the current location
> of the next buffer write of a trace_seq object, instead of open coding
> it.
>
> This facilitates the conversion of trace_seq to use seq_buf.
>
> Cc: Chen Gong <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: Tony Luck <[email protected]>
> Signed-off-by: Steven Rostedt <[email protected]>

Acked-by: Borislav Petkov <[email protected]>

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

2014-11-05 10:29:56

by Petr Mladek

[permalink] [raw]
Subject: Re: [RFC][PATCH 02/12 v3] RAS/tracing: Use trace_seq_buffer_ptr() helper instead of open coded

On Tue 2014-11-04 10:52:39, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <[email protected]>
>
> Use the helper function trace_seq_buffer_ptr() to get the current location
> of the next buffer write of a trace_seq object, instead of open coding
> it.
>
> This facilitates the conversion of trace_seq to use seq_buf.
>
> Cc: Chen Gong <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: Tony Luck <[email protected]>
> Signed-off-by: Steven Rostedt <[email protected]>

Reviewed-by: Petr Mladek <[email protected]>

Best Regards,
Petr