[PATCH] staging: unisys: added virtpci info entry

2014-07-16 Thread Erik Arfvidson
This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson Signed-off-by: Benjamin Romer --- v6: Edit version description and add MAX_BUF documentation v5: Adjusted comments and formatting, remove info_debugfs_entry unused dentry structure v

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-15 Thread Greg KH
On Tue, Jul 15, 2014 at 11:38:16AM -0400, Erik Arfvidson wrote: > This patch adds the virtpci debugfs directory and the info entry > inside of it. > > Signed-off-by: Erik Arfvidson > Signed-off-by: Benjamin Romer > --- > v5: Adjusted comments and formatting, remove unused function What unused f

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-15 Thread Greg KH
On Tue, Jul 15, 2014 at 11:31:03AM -0400, Erik Arfvidson wrote: > > On 07/15/2014 10:45 AM, Greg KH wrote: > >[SNIP] > >+#define MAX_BUF 16384 > >Lovely magic number, care to explain why this is this size? > > Assuming we have the maximum possible configuration: > 4 busses, 32 devices per bus, an

[PATCH] staging: unisys: added virtpci info entry

2014-07-15 Thread Erik Arfvidson
This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson Signed-off-by: Benjamin Romer --- v5: Adjusted comments and formatting, remove unused function v4: Fixed comments, upper bound buffer, removed #define for virtpci and info, modified p

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-15 Thread Erik Arfvidson
On 07/15/2014 10:45 AM, Greg KH wrote: [SNIP] +#define MAX_BUF 16384 Lovely magic number, care to explain why this is this size? Assuming we have the maximum possible configuration: 4 busses, 32 devices per bus, and we assume max of 80 characters per linegives us 10,560 bytes which rounds up t

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-15 Thread Greg KH
On Tue, Jul 15, 2014 at 10:36:43AM -0400, Erik Arfvidson wrote: > This patch adds the virtpci debugfs directory and the info entry > inside of it. > > Signed-off-by: Erik Arfvidson > Signed-off-by: Benjamin Romer > --- > v4: Fixed comments, upper bound buffer, removed #define for virtpci and inf

[PATCH] staging: unisys: added virtpci info entry

2014-07-15 Thread Erik Arfvidson
This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson Signed-off-by: Benjamin Romer --- v4: Fixed comments, upper bound buffer, removed #define for virtpci and info, modified printvbus to work with scnprintf and added and extra element t

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-14 Thread Erik Arfvidson
On 07/11/2014 08:09 PM, Greg KH wrote: [snip] + if (!vbuf) + return -ENOMEM; + + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + " Virtual PCI Bus devices\n"); Why the leading ' '? It's the formatting the original author chose to output th

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-12 Thread Dan Carpenter
On Fri, Jul 11, 2014 at 07:11:45PM -0400, Erik Arfvidson wrote: > +static int print_vbus(struct device *vbus, void *data) > +{ > + struct print_vbus_info *p = (struct print_vbus_info *)data; > + > + *p->length += sprintf(p->buf + *p->length, "bus_id:%s\n", > + dev_

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-11 Thread Greg KH
On Fri, Jul 11, 2014 at 07:11:45PM -0400, Erik Arfvidson wrote: > This patch adds the virtpci debugfs directory and the info entry > inside of it. > > Signed-off-by: Erik Arfvidson > Signed-off-by: Benjamin Romer > --- > v3: Fixed formating and comments. Also added debufs_remove_recursive() and

[PATCH] staging: unisys: added virtpci info entry

2014-07-11 Thread Erik Arfvidson
This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson Signed-off-by: Benjamin Romer --- v3: Fixed formating and comments. Also added debufs_remove_recursive() and simple simple_read_from_buffer() v2: fixed comments and applied Dan Carpen

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-10 Thread Greg KH
On Thu, Jul 10, 2014 at 02:45:12PM -0400, Erik Arfvidson wrote: > This patch adds the virtpci debugfs directory and the info entry > inside of it. > > Signed-off-by: Erik Arfvidson > --- > drivers/staging/unisys/virtpci/virtpci.c | 123 > ++- > 1 file changed, 119 in

Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-10 Thread Dan Carpenter
On Thu, Jul 10, 2014 at 02:45:12PM -0400, Erik Arfvidson wrote: > + str_pos += snprintf(vbuf + str_pos, len - str_pos, "\n"); > + if (copy_to_user(buf, vbuf, str_pos)) { The length checking here still isn't correct. snprintf() returns the number of bytes which would have been printed if t

[PATCH] staging: unisys: added virtpci info entry

2014-07-10 Thread Erik Arfvidson
This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson --- drivers/staging/unisys/virtpci/virtpci.c | 123 ++- 1 file changed, 119 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.