From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] staging: vme: Simplfy string usage in vme_user_probe()
Date: Fri, 04 Apr 2014 08:50:37 +0000 [thread overview]
Message-ID: <533E725D.8090200@bfs.de> (raw)
In-Reply-To: <1396544171-2458-1-git-send-email-prtvar.b@gmail.com>
looks good to me
reviewed-by: wharms <wharms@bfs.de>
@Bojan Prtvar:
please note that i am not the maintainer
Am 03.04.2014 18:56, schrieb Bojan Prtvar:
> We can avoid usage of sprintf() and magic-sized array with simple pointer assignment.
>
> Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
> ---
> This parch should be applied on top of
> "staging: vme: Fix a small coding style issue in vme_user.c"
>
> Compile tested only.
>
> drivers/staging/vme/devices/vme_user.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index 481192a..5fa7f83 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -684,7 +684,7 @@ static int vme_user_match(struct vme_dev *vdev)
> static int vme_user_probe(struct vme_dev *vdev)
> {
> int i, err;
> - char name[12];
> + char *name;
>
> /* Save pointer to the bridge device */
> if (vme_user_bridge != NULL) {
> @@ -794,13 +794,13 @@ static int vme_user_probe(struct vme_dev *vdev)
>
> switch (type[i]) {
> case MASTER_MINOR:
> - sprintf(name, "bus/vme/m%%d");
> + name = "bus/vme/m%d";
> break;
> case CONTROL_MINOR:
> - sprintf(name, "bus/vme/ctl");
> + name = "bus/vme/ctl";
> break;
> case SLAVE_MINOR:
> - sprintf(name, "bus/vme/s%%d");
> + name = "bus/vme/s%d";
> break;
> default:
> err = -EINVAL;
prev parent reply other threads:[~2014-04-04 8:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-03 16:56 [PATCH] staging: vme: Simplfy string usage in vme_user_probe() Bojan Prtvar
2014-04-04 8:50 ` walter harms [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=533E725D.8090200@bfs.de \
--to=wharms@bfs.de \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox