From: Bart Van Assche <bvanassche@acm.org>
To: Hannes Reinecke <hare@suse.de>,
James Bottomley <jbottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@infradead.org>,
Jeremy Linton <jlinton@tributary.com>, Kay Sievers <kay@vrfy.org>,
Doug Gilbert <dgilbert@interlog.com>,
Kai Makisara <kai.makisara@kolumbus.fi>
Subject: Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs
Date: Sun, 02 Mar 2014 09:34:32 +0100 [thread overview]
Message-ID: <5312ED18.8080905@acm.org> (raw)
In-Reply-To: <1392287281-75002-3-git-send-email-hare@suse.de>
On 02/13/14 11:28, Hannes Reinecke wrote:
> static ssize_t
> -show_iostat_counterbits(struct device *dev, struct device_attribute *attr, char *buf)
> +show_vpd_pg(const unsigned char *pg_buf, int pg_len, char *buf)
> +{
> + int len = 0, i;
> +
> + if (!pg_buf)
> + return -EINVAL;
> +
> + len = 0;
> + for (i = 0; i < pg_len; i += 16) {
> + hex_dump_to_buffer(pg_buf + i, pg_len, 16, 1,
> + buf + len, PAGE_SIZE, false);
> + strcat(buf + len, "\n");
> + len += strlen(buf + len);
> + }
> + return len;
> +}
It might be a good idea to add the output buffer length as an argument
in show_vpd_pg() and to check explicitly whether or not there is
sufficient space left in the output buffer.
Bart.
next prev parent reply other threads:[~2014-03-02 8:34 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 10:27 [PATCHv7 0/3][Resend] Display EVPD pages in sysfs Hannes Reinecke
2014-02-13 10:27 ` [PATCH 1/3] scsi_sysfs: Implement 'is_visible' callback Hannes Reinecke
2014-02-13 10:28 ` [PATCH 2/3] Add EVPD page 0x83 to sysfs Hannes Reinecke
2014-03-02 8:34 ` Bart Van Assche [this message]
2014-03-05 7:56 ` Hannes Reinecke
2014-03-02 8:36 ` Bart Van Assche
2014-03-05 7:56 ` Hannes Reinecke
2014-02-13 10:28 ` [PATCH 3/3] Add EVPD page 0x80 " Hannes Reinecke
2014-02-28 7:27 ` [PATCHv7 0/3][Resend] Display EVPD pages in sysfs Hannes Reinecke
2014-03-02 8:53 ` Bart Van Assche
2014-03-05 8:00 ` Hannes Reinecke
2014-03-05 8:23 ` Bart Van Assche
2014-03-05 8:34 ` Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2014-02-13 10:07 [PATCHv7 0/3] " Hannes Reinecke
2014-02-13 10:07 ` [PATCH 2/3] Add EVPD page 0x83 to sysfs Hannes Reinecke
2014-02-28 17:01 ` Christoph Hellwig
2014-03-05 7:38 ` Hannes Reinecke
2014-03-05 19:42 ` Christoph Hellwig
2014-03-06 9:01 ` Hannes Reinecke
2014-03-07 10:11 ` Christoph Hellwig
2014-03-07 10:35 ` Hannes Reinecke
2014-03-07 10:44 ` Christoph Hellwig
2014-03-07 10:39 ` James Bottomley
2014-03-07 10:51 ` Hannes Reinecke
2014-03-07 11:01 ` James Bottomley
2014-03-07 11:18 ` Douglas Gilbert
2014-03-07 13:39 ` Hannes Reinecke
2014-03-07 10:40 ` James Bottomley
2014-03-07 10:43 ` Christoph Hellwig
2014-03-07 10:57 ` James Bottomley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5312ED18.8080905@acm.org \
--to=bvanassche@acm.org \
--cc=dgilbert@interlog.com \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=jbottomley@parallels.com \
--cc=jlinton@tributary.com \
--cc=kai.makisara@kolumbus.fi \
--cc=kay@vrfy.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox