From: Ian Abbott <abbotti@mev.co.uk>
To: B K Karthik <bkkarthik@pesu.pes.edu>,
H Hartley Sweeten <hsweeten@visionengravers.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Vlastimil Babka <vbabka@suse.cz>,
Xiyu Yang <xiyuyang19@fudan.edu.cn>,
Michel Lespinasse <walken@google.com>,
Divyansh Kamboj <kambojdivyansh2000@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings
Date: Fri, 17 Jul 2020 10:47:55 +0100 [thread overview]
Message-ID: <8afee168-b65c-dafe-59f6-32d1c59d87dc@mev.co.uk> (raw)
In-Reply-To: <20200716152548.mzau4zhurwkzp5p6@pesu-pes-edu>
On 16/07/2020 16:25, B K Karthik wrote:
> fixed sparse warnings by adding a cast in assignment from
> void [noderef] __user * to unsigned int __force *
> and a reverse cast in argument from
> unsigned int * to unsigned int __user * .
>
> v1 -> v2:
> - Add a reverse cast in argument
> v2 -> v3:
> - Change commit description as suggested by Ian Abott
> v3 -> v4:
> - Add versioning information in commit description
For future reference, the patch change history should go below the "---"
divider line below where git will ignore it so that it does not appear
in the final commit description. Otherwise, the committer would need to
edit it out manually.
>
> Signed-off-by: B K Karthik <karthik.bk2000@live.com>
> ---
> drivers/staging/comedi/comedi_fops.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> index 3f70e5dfac39..9cdc1e8a022d 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
> cmd->scan_end_arg = v32.scan_end_arg;
> cmd->stop_src = v32.stop_src;
> cmd->stop_arg = v32.stop_arg;
> - cmd->chanlist = compat_ptr(v32.chanlist);
> + cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist);
> cmd->chanlist_len = v32.chanlist_len;
> cmd->data = compat_ptr(v32.data);
> cmd->data_len = v32.data_len;
> @@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32,
> v32.stop_src = cmd->stop_src;
> v32.stop_arg = cmd->stop_arg;
> /* Assume chanlist pointer is unchanged. */
> - v32.chanlist = ptr_to_compat(cmd->chanlist);
> + v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist);
> v32.chanlist_len = cmd->chanlist_len;
> v32.data = ptr_to_compat(cmd->data);
> v32.data_len = cmd->data_len;
>
Still looks good.
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268. Registered address: )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
next prev parent reply other threads:[~2020-07-17 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 15:25 B K Karthik
2020-07-17 9:47 ` Ian Abbott [this message]
2020-07-17 10:07 ` Greg Kroah-Hartman
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=8afee168-b65c-dafe-59f6-32d1c59d87dc@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=bkkarthik@pesu.pes.edu \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=kambojdivyansh2000@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=viro@zeniv.linux.org.uk \
--cc=walken@google.com \
--cc=xiyuyang19@fudan.edu.cn \
/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
all inboxes | Powered by JetHome®