From: "ira.weiny" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org,
faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH 12/13] IB/core: Export a common fw_ver sysfs entry
Date: Mon, 13 Jun 2016 22:54:44 -0400 [thread overview]
Message-ID: <20160614025443.GB25688@phlsvsds.ph.intel.com> (raw)
In-Reply-To: <20160609224038.GB13366-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On Thu, Jun 09, 2016 at 04:40:38PM -0600, Jason Gunthorpe wrote:
> On Thu, Jun 09, 2016 at 05:54:07PM -0400, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> >
> > +static ssize_t show_fw_ver(struct device *device, struct device_attribute *attr,
> > + char *buf)
> > +{
> > + char tmp[ETHTOOL_FWVERS_LEN];
> > + struct ib_device *dev = container_of(device, struct ib_device, dev);
> > +
> > + ib_get_device_fw_str(dev, tmp, sizeof(tmp));
> > +
> > + return scnprintf(buf, PAGE_SIZE, "%s\n", tmp);
>
> No need to use the stack:
>
> ib_get_device_fw_str(dev, buf, PAGE_SIZE);
> strlcat(buf, "", PAGE_SIZE);
> return strlen(buf);
That works. Fixes Leon's comment as well.
Done.
>
> > &dev_attr_node_guid,
> > - &dev_attr_node_desc
> > + &dev_attr_node_desc,
> > + &dev_attr_fw_ver
>
> Should be
> + &dev_attr_fw_ver,
>
> Note trailing comma. Avoids git churn like the above on append.
Done.
Ira
>
> Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-06-14 2:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 21:53 [PATCH 00/13] Create device FW version call back ira.weiny-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1465509248-11324-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-09 21:53 ` [PATCH 01/13] IB/core: Add get FW version string to the core ira.weiny-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1465509248-11324-2-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-09 22:29 ` Jason Gunthorpe
[not found] ` <20160609222919.GA13366-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-14 2:45 ` ira.weiny
2016-06-09 21:53 ` [PATCH 02/13] IB/cxgb3: Support device FW version string ira.weiny-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1465509248-11324-3-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-10 13:49 ` Steve Wise
2016-06-09 21:53 ` [PATCH 03/13] IB/cxgb4: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1465509248-11324-4-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-10 13:50 ` Steve Wise
2016-06-09 21:53 ` [PATCH 04/13] IB/i40iw: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 05/13] IB/mlx4: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 06/13] IB/mlx5: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 07/13] IB/mthca: Supprot " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 08/13] IB/nes: Support " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 09/13] IB/ocrdma: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 10/13] IB/usnic: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 11/13] IB/ipoib: Use new " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-09 21:54 ` [PATCH 12/13] IB/core: Export a common fw_ver sysfs entry ira.weiny-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1465509248-11324-13-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-09 22:40 ` Jason Gunthorpe
[not found] ` <20160609224038.GB13366-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-10 14:00 ` Leon Romanovsky
[not found] ` <20160610140059.GB5408-2ukJVAZIZ/Y@public.gmane.org>
2016-06-14 2:56 ` ira.weiny
2016-06-14 2:54 ` ira.weiny [this message]
2016-06-09 21:54 ` [PATCH 13/13] IB/hfi1: Add device FW version string ira.weiny-ral2JQCrhuEAvxtiuMwx3w
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=20160614025443.GB25688@phlsvsds.ph.intel.com \
--to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org \
--cc=dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.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