From: Jakub Jelinek <jakub@redhat.com>
To: Daniel Walker <dwalker@mvista.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm] idetape gcc 4.1 warning fix
Date: Wed, 10 May 2006 07:12:05 -0400 [thread overview]
Message-ID: <20060510111205.GQ14147@devserv.devel.redhat.com> (raw)
In-Reply-To: <200605100255.k4A2twOE031688@dwalker1.mvista.com>
On Tue, May 09, 2006 at 07:55:58PM -0700, Daniel Walker wrote:
> Fixes the following warning,
>
> drivers/ide/ide-tape.c: In function âidetape_copy_stage_from_userâ:
> drivers/ide/ide-tape.c:2662: warning: ignoring return value of âcopy_from_userâ, declared with attribute warn_unused_result
> drivers/ide/ide-tape.c: In function âidetape_copy_stage_to_userâ:
> drivers/ide/ide-tape.c:2689: warning: ignoring return value of âcopy_to_userâ, declared with attribute warn_unused_result
>
> Signed-Off-By: Daniel Walker <dwalker@mvista.com>
>
> Index: linux-2.6.16/drivers/ide/ide-tape.c
> ===================================================================
> --- linux-2.6.16.orig/drivers/ide/ide-tape.c
> +++ linux-2.6.16/drivers/ide/ide-tape.c
> @@ -2659,7 +2659,7 @@ static void idetape_copy_stage_from_user
> }
> #endif /* IDETAPE_DEBUG_BUGS */
> count = min((unsigned int)(bh->b_size - atomic_read(&bh->b_count)), (unsigned int)n);
> - copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count);
> + WARN_ON(copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count));
WARN_ON is certainly not a good way to hide this warning.
Having a user-triggerable WARN_ON is a bad idea.
Instead you should add some error handling.
Jakub
next prev parent reply other threads:[~2006-05-10 11:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-10 2:55 [PATCH -mm] idetape gcc 4.1 warning fix Daniel Walker
2006-05-10 10:42 ` Alan Cox
2006-05-10 11:12 ` Jakub Jelinek [this message]
2006-05-10 14:07 ` Daniel Walker
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=20060510111205.GQ14147@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=akpm@osdl.org \
--cc=dwalker@mvista.com \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.