From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292AbdJTNe3 (ORCPT ); Fri, 20 Oct 2017 09:34:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33594 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751804AbdJTNe2 (ORCPT ); Fri, 20 Oct 2017 09:34:28 -0400 Date: Fri, 20 Oct 2017 15:34:36 +0200 From: Greg KH To: srinivas.kandagatla@linaro.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: Re: [PATCH 04/12] nvmem: qfprom: fix different address space warnings of sparse Message-ID: <20171020133436.GC9301@kroah.com> References: <20171009132641.27169-1-srinivas.kandagatla@linaro.org> <20171009132641.27169-5-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171009132641.27169-5-srinivas.kandagatla@linaro.org> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 09, 2017 at 03:26:33PM +0200, srinivas.kandagatla@linaro.org wrote: > From: Masahiro Yamada > > Fix the following sparse warnings: > > drivers/nvmem/qfprom.c:23:30: warning: incorrect type in initializer (different address spaces) > drivers/nvmem/qfprom.c:23:30: expected void [noderef] *base > drivers/nvmem/qfprom.c:23:30: got void *context > drivers/nvmem/qfprom.c:36:30: warning: incorrect type in initializer (different address spaces) > drivers/nvmem/qfprom.c:36:30: expected void [noderef] *base > drivers/nvmem/qfprom.c:36:30: got void *context > drivers/nvmem/qfprom.c:76:22: warning: incorrect type in assignment (different address spaces) > drivers/nvmem/qfprom.c:76:22: expected void *static [toplevel] [assigned] priv > drivers/nvmem/qfprom.c:76:22: got void [noderef] *[assigned] base > > The type of nvmem_config->priv is (void *), so sparse complains > about assignment of the base address with (void __iomem *) type. > > Even if we cast it out, sparse still warns: > warning: cast removes address space of expression > > Of course, we can shut up the sparse by marking __force, but a more > correct way is to put the base address into driver private data. Same objection here. Don't hide things like this. greg k-h