Re: [PATCH] IB/core: Make device counter infrastructure dynamic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 19, 2016 at 05:35:13PM -0400, Doug Ledford wrote:

> +	return sprintf(buf, "%d msecs (rounded from jiffies), 0-10000 allowed "
> +		       "range\n", msecs);

sysfs files should not have usage commentary like that, just use the
%d

> +char *names[] = {

static const char * const names[] = {

For Kees

> +	[NR_COUNTERS] = NULL

Don't really need this, just use ARRAY_SIZE(names) in place of
NR_COUTNERS

> +       stats = kzalloc(sizeof(*stats) + NR_COUNTERS * sizeof(u64), GFP_KERNEL);

People have been switching the above pattern to use kcalloc

> +static char *names[] = {
> +	[TCPINSEGS] = "tcpInSegs",
> +	[TCPOUTSEGS] = "tcpOutSegs",
> +	[TCPRETRANSSEGS] = "tcpRetransSegs",
> +	[TCPOUTRSTS] = "tcpOutRsts",
> +	[NR_COUNTERS] = NULL
> +};

ditto

> +static char *i40iw_hw_stat_names[] = {

ditto

> +	[I40IW_HW_STAT_INDEX_MAX_64 + I40IW_HW_STAT_INDEX_MAX_32] = ""

Why an empty string?

> +	char		*dirname; /* Sysfs directory name */
> +	char		**name;   /* array of names of the counters in the
> +				   * sysfs dir

const char * const *name

Trailing comments are not the kdoc standard for structure members,
IIRC.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux