Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753209AbcLGPc2 (ORCPT ); Wed, 7 Dec 2016 10:32:28 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:46702 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbcLGPc1 (ORCPT ); Wed, 7 Dec 2016 10:32:27 -0500 Date: Wed, 7 Dec 2016 18:32:14 +0300 From: Dan Carpenter To: Quentin Lambert Cc: Oleg Drokin , devel@driverdev.osuosl.org, Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Dilger , lustre-devel@lists.lustre.org Subject: Re: [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Message-ID: <20161207153214.GN8176@mwanda> References: <20161202173332.5100-1-lambert.quentin@gmail.com> <306D1D4D-A949-44F6-BAFE-44F08F609D9B@intel.com> <81821426-c32c-c45a-e9a3-82f9818fc986@gmail.com> <33d23121-e5ca-0e14-bfbb-632f883e0948@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33d23121-e5ca-0e14-bfbb-632f883e0948@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 988 Lines: 29 On Wed, Dec 07, 2016 at 04:20:06PM +0100, Quentin Lambert wrote: > Hi all, > > I am looking at the drivers/staging/lustre/lustre/llite/dir.c: > > 1469 /* Call mdc_iocontrol */ > 1470 rc = obd_iocontrol(LL_IOC_FID2MDTIDX, exp, > sizeof(fid), &fid, > 1471 &index); > 1472 if (rc) > > and sparse says: > > drivers/staging/lustre/lustre/llite/dir.c:1471:37: warning: > incorrect type in argument 5 (different address spaces) > > I was wondering if there was any value to add a cast to fix the warning? > And I guess this solution would also apply in my original patch to > > drivers/staging/lustre/lnet/lnet/lib-socket.c Just leave these alone until someone can come clean it up properly. Warnings are good! People have spent years and years to create programs to print warnings. Don't silence the warning by adding a cast. The warning means show that the code is dangerous. regards, dan carpenter