RE: [PATCH v2 12/30] cxlflash: Refine host/device attributes

2015-09-21 Thread David Laight
From: Brian King > Sent: 18 September 2015 22:35 ... > > + for (i = 0; i < CXLFLASH_NUM_VLUNS; i++, buf += 22) > > Rather than this bug prone hard coded 22, how about never incrementing buf > and do something > similar to this: > > > + bytes += scnprintf(buf, PAGE_SIZE, "%03d:

Re: [PATCH v2 12/30] cxlflash: Refine host/device attributes

2015-09-18 Thread Matthew R. Ochs
> On Sep 18, 2015, at 4:34 PM, Brian King wrote: > On 09/16/2015 04:29 PM, Matthew R. Ochs wrote: >> >> +ssize_t bytes = 0; >> +__be64 __iomem *fc_port; >> + >> +if (port >= NUM_FC_PORTS) >> +return 0; >> + >> +fc_port =

Re: [PATCH v2 12/30] cxlflash: Refine host/device attributes

2015-09-18 Thread Brian King
On 09/16/2015 04:29 PM, Matthew R. Ochs wrote: > Implement the following suggestions and add two new attributes > to allow for debugging the port LUN table. > > - use scnprintf() instead of snprintf() > - use DEVICE_ATTR_RO and DEVICE_ATTR_RW > > Signed-off-by: Matthew R. Ochs