Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752342AbdLGJTs (ORCPT ); Thu, 7 Dec 2017 04:19:48 -0500 Received: from smtp.nue.novell.com ([195.135.221.5]:41480 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750869AbdLGJTr (ORCPT ); Thu, 7 Dec 2017 04:19:47 -0500 Date: Thu, 7 Dec 2017 10:19:43 +0100 From: Hannes Reinecke To: Arnd Bergmann Cc: Anil Gurumurthy , Sudarsana Kalluru , "James E.J. Bottomley" , "Martin K. Petersen" , Johannes Thumshirn , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: bfa: fix type conversion warning Message-ID: <20171207101943.7e01248c@pentland.suse.de> In-Reply-To: <20171206141444.634681-1-arnd@arndb.de> References: <20171206141444.634681-1-arnd@arndb.de> Organization: SUSE Linux GmbH X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1543 Lines: 39 On Wed, 6 Dec 2017 15:14:18 +0100 Arnd Bergmann wrote: > A regression fix introduced a harmless type mismatch warning: > > drivers/scsi/bfa/bfad_bsg.c: In function 'bfad_im_bsg_vendor_request': > drivers/scsi/bfa/bfad_bsg.c:3137:35: error: initialization of 'struct > bfad_im_port_s *' from 'long unsigned int' makes pointer from integer > without a cast [-Werror=int-conversion] struct bfad_im_port_s > *im_port = shost->hostdata[0]; ^~~~~ drivers/scsi/bfa/bfad_bsg.c: In > function 'bfad_im_bsg_els_ct_request': > drivers/scsi/bfa/bfad_bsg.c:3353:35: error: initialization of 'struct > bfad_im_port_s *' from 'long unsigned int' makes pointer from integer > without a cast [-Werror=int-conversion] struct bfad_im_port_s > *im_port = shost->hostdata[0]; > > This changes the code back to shost_priv() once more, but encapsulates > it in an inline function to document the rather unusual way of > using the private data only as a pointer to the previously allocated > structure. > > I did not try to get rid of the extra indirection level entirely, > which would have been rather invasive and required reworking the > entire initialization sequence. > > Fixes: 45349821ab3a ("scsi: bfa: fix access to bfad_im_port_s") > Signed-off-by: Arnd Bergmann > --- > drivers/scsi/bfa/bfad_bsg.c | 4 ++-- > drivers/scsi/bfa/bfad_im.c | 6 ++++-- > drivers/scsi/bfa/bfad_im.h | 10 ++++++++++ > 3 files changed, 16 insertions(+), 4 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes