Linux EDAC development
 help / color / mirror / Atom feed
* [RFC,4/8] seq_buf: Add seq_buf_clear_buf()
@ 2017-07-28  1:43 Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2017-07-28  1:43 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-edac, Tony Luck, Yazen Ghannam, X86 ML, LKML

On Tue, 25 Jul 2017 17:45:57 +0200
Borislav Petkov <bp@alien8.de> wrote:

> From: Borislav Petkov <bp@suse.de>
> 
> This is the version which clears the supplied buffer too. Useful when
> we're done with the buffer and want to clean it up and prepare it for
> reuse.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: Steven Rostedt <rostedt@goodmis.org>

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

> ---
>  include/linux/seq_buf.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
> index fb7eb9ccb1cd..8705a482e76c 100644
> --- a/include/linux/seq_buf.h
> +++ b/include/linux/seq_buf.h
> @@ -28,6 +28,13 @@ static inline void seq_buf_clear(struct seq_buf *s)
>  	s->readpos = 0;
>  }
>  
> +/* Like seq_buf_clear() but zero out the buffer too. */
> +static inline void seq_buf_clear_buf(struct seq_buf *s)
> +{
> +	seq_buf_clear(s);
> +	memset(s->buffer, 0, s->size);
> +}
> +
>  static inline void
>  seq_buf_init(struct seq_buf *s, unsigned char *buf, unsigned int size)
>  {
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [RFC,4/8] seq_buf: Add seq_buf_clear_buf()
@ 2017-07-25 15:45 Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2017-07-25 15:45 UTC (permalink / raw)
  To: linux-edac; +Cc: Steven Rostedt, Tony Luck, Yazen Ghannam, X86 ML, LKML

From: Borislav Petkov <bp@suse.de>

This is the version which clears the supplied buffer too. Useful when
we're done with the buffer and want to clean it up and prepare it for
reuse.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/seq_buf.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
index fb7eb9ccb1cd..8705a482e76c 100644
--- a/include/linux/seq_buf.h
+++ b/include/linux/seq_buf.h
@@ -28,6 +28,13 @@ static inline void seq_buf_clear(struct seq_buf *s)
 	s->readpos = 0;
 }
 
+/* Like seq_buf_clear() but zero out the buffer too. */
+static inline void seq_buf_clear_buf(struct seq_buf *s)
+{
+	seq_buf_clear(s);
+	memset(s->buffer, 0, s->size);
+}
+
 static inline void
 seq_buf_init(struct seq_buf *s, unsigned char *buf, unsigned int size)
 {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-28  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-28  1:43 [RFC,4/8] seq_buf: Add seq_buf_clear_buf() Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2017-07-25 15:45 Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox