OSDN Git Service

staging: kpc2000: added separate show functions for kpc_uio_class device attributes...
authorJeremy Sowden <jeremy@azazel.net>
Tue, 21 May 2019 07:56:28 +0000 (08:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 May 2019 08:30:21 +0000 (10:30 +0200)
commitcd88d2b11dc34b794e65d7aec64bd35086749945
treea76f0be7d7c850490ff0ef739374f180211b7b7a
parentae63ed4c7d0857cb0ed3c69f7e597745706c0f59
staging: kpc2000: added separate show functions for kpc_uio_class device attributes, defined them as read-only and declared them static.

Defined separate simple show functions for each attribute instead of
having a one big one containing a chain of conditionals.

Replaced scnprintf calls with sprintf since all the outputs are short
bounded strings or single integers.

All of the device attributes are read-only, so used DEVICE_ATTR_RO to
define them.

The definitions are only used to populate the kpc_uio_class_attrs
attribute array, so declared them as static.

Fixes the following sparse warnings:

  drivers/staging/kpc2000/kpc2000/cell_probe.c:220:1: warning: symbol 'dev_attr_offset' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:221:1: warning: symbol 'dev_attr_size' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:222:1: warning: symbol 'dev_attr_type' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:223:1: warning: symbol 'dev_attr_s2c_dma' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:224:1: warning: symbol 'dev_attr_c2s_dma' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:225:1: warning: symbol 'dev_attr_irq_count' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:226:1: warning: symbol 'dev_attr_irq_base_num' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:227:1: warning: symbol 'dev_attr_core_num' was not declared. Should it be static?

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc2000/cell_probe.c