Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1300148ybh; Thu, 16 Jul 2020 08:26:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeTNtDUsILxjdxvg8KhvTNCf82nLmynK+U7WRWHqTZyAbgxBLuMAxqucZEu8/6JaemhlLb X-Received: by 2002:a17:906:2296:: with SMTP id p22mr4123975eja.510.1594913188562; Thu, 16 Jul 2020 08:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594913188; cv=none; d=google.com; s=arc-20160816; b=sc9xguysnbHJ6G5FNnQBQTqwNXAzdHANEIwD9ErVXo8buANdaAkvaVTENiBH5w1CVO 1Imsh6PnLNXcR2lenpmuWH+usvehOYmQI0i/pP8mPDNx4e40e/NT8lpe7LrL3ShiBtE1 Rwu1NdM5TwlT4yzWYlegABvPazP7zIAu2oxTgkKzHSXvg+m44EGdWl/k9tQsW5XsYCO6 gdpFHZHHj1HXdGWGTxJ6CYG7g7Qp20prHEueNlJ+X2uW7UbfOhTnun/jLkzP1+AoTJQR jSTzt3gSkc86/HyCSf9Bo5wedmYxzTGGsaOGG2KYCOzbi+mY+1rRmQBTwknQ91XmYdvV bKbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:date:from:dkim-signature; bh=RMKMbC5jYSfPNsKIURX7KQu3FS04i/MQG7VAJB3u/Kg=; b=ZqFGnT+E5L+nssNBvg2M7HpHo7BywYeuldEr6lUnL40n33VyIxHTdguw5XnkSzONSH 1/j/1Mhu2vLAFDGl8cjZm/V7LXpsAmvPUOrEiHJNchNOzZhF1t73yAO/4pNARK+x6pOQ Kq4Wk5cHORQOavzx8R+UeY4RwaaUNNz3sjyfniW+/xv4EaBNUo/1t+zHi3KxQQja6LXO 90itMjNexaanXBhxUe8Y3gSX4maoTp/3tjt7BTWGmykUdnfgegT0Rgcb42mbcEtxCsg9 cIBEuXV0Hs1pbZvh8pEqsY2U/jn13YcpmgL5/8gJTDsZWQuY/E6uoT/AseFcm142uiyM KSQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pesu-pes-edu.20150623.gappssmtp.com header.s=20150623 header.b=XurTJMQX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pes.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d92si3371927edd.183.2020.07.16.08.26.05; Thu, 16 Jul 2020 08:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pesu-pes-edu.20150623.gappssmtp.com header.s=20150623 header.b=XurTJMQX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pes.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728783AbgGPPZ4 (ORCPT + 99 others); Thu, 16 Jul 2020 11:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728638AbgGPPZ4 (ORCPT ); Thu, 16 Jul 2020 11:25:56 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F95DC061755 for ; Thu, 16 Jul 2020 08:25:56 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id b92so4837724pjc.4 for ; Thu, 16 Jul 2020 08:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pesu-pes-edu.20150623.gappssmtp.com; s=20150623; h=from:date:to:subject:message-id:mime-version:content-disposition :user-agent; bh=RMKMbC5jYSfPNsKIURX7KQu3FS04i/MQG7VAJB3u/Kg=; b=XurTJMQXdm8hRwI+aCQKonbNg+WUWjOVflr2fLG+ZlavH5vJ3sZWzyX8e+3lQT6nww Fqaj31wduC2ih/0GDg1qJMsLORsBrfa9THtII199vpWx1MCYgYjsB4Zer9F0fd+/9zwJ JtBNxeGVCMYFrwK2cFVnWg3Bt1uR53YWvWjQ+L6502WZcuvEkX1zhOn3zFxCdFrtZuIm tgso+MFNt5TccK0rKHVHCf15jJO02Sfz3O7no3Nrq0H5WM6Qq7osal444fjhMmWUmZG3 FwYshoN8R/vGAbjfoJOF8pUWL/EJ9PmS3O4VRft+4l0vnVI35R7kDBnuB3K9O+I07Kl/ mFag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:subject:message-id:mime-version :content-disposition:user-agent; bh=RMKMbC5jYSfPNsKIURX7KQu3FS04i/MQG7VAJB3u/Kg=; b=opKIfs0T3E0cYgegAypwGxbvoXJiSh84ty0vLfWVPNrMidyUgzjVmwtttgkabHZ4jX fFW0hYMCZDF/TyS0hsC4ayzOiU6wkaTefJK3dG+0ZgEyxsE8P47P02dqj9v4G1tpkSLD w98+bfEMjenqupFMCS2V4TOvTIfsodoT7wMoQhM4gSrLffZnTnouu6eX+wGOdMJSHZAp JK6StnyjFkeywnseM5HZaMJ8y6y9MM7r+80+xUbeeG8nYQYD/RqVWhFzPgQoQ/CNiLJ+ 7dBsju2FGXL1ox48AznV8cpwT+h5ulfEAy0ovX5xrZ5sUdBhhaXHgmBLkS3b2lGJlgEs KZ6Q== X-Gm-Message-State: AOAM530CNZqMHOIlvJJcu/6yW9hDGLIK9BNp51MBWPyLGeFTiz2K6rAa Lapr+3FWgQxMwAsp+V103Jnl4w== X-Received: by 2002:a17:90b:196:: with SMTP id t22mr753125pjs.13.1594913155420; Thu, 16 Jul 2020 08:25:55 -0700 (PDT) Received: from localhost ([2406:7400:73:bebb:9750:968d:7cd5:3ec7]) by smtp.gmail.com with ESMTPSA id c207sm5162589pfb.159.2020.07.16.08.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 08:25:53 -0700 (PDT) From: B K Karthik X-Google-Original-From: B K Karthik Date: Thu, 16 Jul 2020 11:25:48 -0400 To: Ian Abbott , H Hartley Sweeten , Greg Kroah-Hartman , Al Viro , Vlastimil Babka , Xiyu Yang , Michel Lespinasse , Divyansh Kamboj , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v4] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings Message-ID: <20200716152548.mzau4zhurwkzp5p6@pesu-pes-edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jmkhzignupuhzb25" Content-Disposition: inline User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jmkhzignupuhzb25 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 Signed-off-by: B K Karthik --- 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 =3D v32.scan_end_arg; cmd->stop_src =3D v32.stop_src; cmd->stop_arg =3D v32.stop_arg; - cmd->chanlist =3D compat_ptr(v32.chanlist); + cmd->chanlist =3D (unsigned int __force *)compat_ptr(v32.chanlist); cmd->chanlist_len =3D v32.chanlist_len; cmd->data =3D compat_ptr(v32.data); cmd->data_len =3D v32.data_len; @@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct = __user *cmd32, v32.stop_src =3D cmd->stop_src; v32.stop_arg =3D cmd->stop_arg; /* Assume chanlist pointer is unchanged. */ - v32.chanlist =3D ptr_to_compat(cmd->chanlist); + v32.chanlist =3D ptr_to_compat((unsigned int __user *)cmd->chanlist); v32.chanlist_len =3D cmd->chanlist_len; v32.data =3D ptr_to_compat(cmd->data); v32.data_len =3D cmd->data_len; --=20 2.20.1 --jmkhzignupuhzb25 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEpIrzAt4LvWLJmKjp471Q5AHeZ2oFAl8QcXwACgkQ471Q5AHe Z2pXMwv/dD/m/gD6ll7ullSAXYCoCM7i9lvWbRpA9dp3rk3rmqQnig1pL0sM5NfN O+ce32drCrgL41P41bKYbZA5FzaLZnsyobrp+4uDIN4dsy+tYOxqXevIW1+7la0F 8NsA3hbZwrTWlxXCuiGysLN3axa7/ZkVFTdgvbmo1QyZaWIUn0GEGM9Pu/+VuHJu X6zo0C4wgdHdxwAVOWE9q8Rf7AVC+cqLCmD32+OvyAxDONgdflijKJRJaFYnBitv 9tcxrrvxMDcFcUp3k03NIeMj6gtyOmXjR8/6jSouGolkdwPSXe5en1f6WkciGC1N D6WsfImiVaOzrtZG73ga7dUPyRqj5Ra0KA2MZSuPLks1H6dGz1W4gzCO0r1FRGM0 acxoIlW0fuFDnX2qUehcLN7ZnFy3dnVazNzzKqE3jSUIJ0Drzwljr4udE7btBITO LCzrHlJJVZHeUpGam5Wf/1SvDoKk0sf15Y9TGLEWXc4HYnw7ghC12L4JdvBbeKxg uOH84aY2 =RRHD -----END PGP SIGNATURE----- --jmkhzignupuhzb25--