staging: vme: Simplfy string usage in vme_user_probe()
We can avoid usage of sprintf() and magic-sized array with simple pointer assignment. Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com> Reviewed-by: wharms <wharms@bfs.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
938acb99ce
commit
f1552cbdc7
|
@ -684,7 +684,7 @@ static int vme_user_match(struct vme_dev *vdev)
|
||||||
static int vme_user_probe(struct vme_dev *vdev)
|
static int vme_user_probe(struct vme_dev *vdev)
|
||||||
{
|
{
|
||||||
int i, err;
|
int i, err;
|
||||||
char name[12];
|
char *name;
|
||||||
|
|
||||||
/* Save pointer to the bridge device */
|
/* Save pointer to the bridge device */
|
||||||
if (vme_user_bridge != NULL) {
|
if (vme_user_bridge != NULL) {
|
||||||
|
@ -794,13 +794,13 @@ static int vme_user_probe(struct vme_dev *vdev)
|
||||||
|
|
||||||
switch (type[i]) {
|
switch (type[i]) {
|
||||||
case MASTER_MINOR:
|
case MASTER_MINOR:
|
||||||
sprintf(name, "bus/vme/m%%d");
|
name = "bus/vme/m%d";
|
||||||
break;
|
break;
|
||||||
case CONTROL_MINOR:
|
case CONTROL_MINOR:
|
||||||
sprintf(name, "bus/vme/ctl");
|
name = "bus/vme/ctl";
|
||||||
break;
|
break;
|
||||||
case SLAVE_MINOR:
|
case SLAVE_MINOR:
|
||||||
sprintf(name, "bus/vme/s%%d");
|
name = "bus/vme/s%d";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue