Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp365849lqo; Thu, 16 May 2024 08:28:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2SH7auyeMhrGAqRft7K4dKtO5MHAJVl2J8QnaUFBzY8I/XJRs4Lpq1Sq/TUSr9YLeNP1JdB4LaOFyykGmUVQh1j94cotImP/m0rOFkg== X-Google-Smtp-Source: AGHT+IF1TumtxWas8zkEutZ2lNRbBJjElSbpsSP6xRle7G0wFxr3xouc7F7oYs3OLDFO+FGNhd+Y X-Received: by 2002:a05:6a20:12d4:b0:1af:6866:165a with SMTP id adf61e73a8af0-1afde07ce7fmr21244698637.7.1715873336411; Thu, 16 May 2024 08:28:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715873336; cv=pass; d=google.com; s=arc-20160816; b=I/maPvm1+2ZfUSEkoDbOrOjRBdS9eN6N47zPHZD0NuNHm/8U+zOcvCpAGvKnd2t9bm OHmfu1GNGfw02+wVnZl43YxSKv4nJ7QBr//YDIdj26Xag/9Kt0Q71f1Jwz3kJCP2UUYT EpyXRUk6I5gQsLKE8HsNE2i6STgfhGk1+hOtdUlKb4dGsAQeHnywG78uJW4LPoLgoWbf F8DScvCkAXt6yQ8nQmNbCUwXcM/ajGxLrPO/Is8RAUHebw34GUdxO6uohMQdvYZH477z ef+jrdAetKA+4LuKsnzWPDIZOlRSxy0vB24OgV8PyOOLiM/vBLoWWY7WDjSQg/l486mL 62pQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=jbX4BYdFZlropC04yZm1f4Zaory1hVxQ/jYcYQnRaMs=; fh=cUsYuJRB5Vv12y6c23C90V19lxyU84+bGu5BPwLkpeI=; b=xi0IfLV1mxry4wpxsWdVHJ4Z0pwH/wZzYXYpvwkXUgcCg7KZ2fJe+Zv7p9Sw8gjRO/ kMxQz4Xi8LWiQfpNlpz7ynCoIj4fEWUdMd3OPYdJEexguPJlviYy8YhrDyg+mh/rD5uQ jV2uzwONkH4iDb85CNxpGpP1l0HtESid1SyMJ2o6FtqL8wONQYhFfmgFxGhUGeCrvc3K BhYZREBHu2R2mC7SZTg1g8aiemwJnaKRJGqpEa7iQ6BXdyyHVSVhGSd7woFTGC20mvKR R1Ol32/Q2YpaV2OPyH2U2C8KdXgCNsIfZY3N3sVqENbVWhEhu2FCY+3oBvQ2g3UsJPZr nRCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=iIMabCed; dkim=pass header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=iRF+9Q2q; arc=pass (i=1 spf=pass spfdomain=fluxnic.net dkim=pass dkdomain=pobox.com dkim=pass dkdomain=fluxnic.net); spf=pass (google.com: domain of linux-kernel+bounces-181243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181243-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-65452ad7fedsi2382194a12.72.2024.05.16.08.28.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 08:28:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=iIMabCed; dkim=pass header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=iRF+9Q2q; arc=pass (i=1 spf=pass spfdomain=fluxnic.net dkim=pass dkdomain=pobox.com dkim=pass dkdomain=fluxnic.net); spf=pass (google.com: domain of linux-kernel+bounces-181243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181243-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0C15A28B204 for ; Thu, 16 May 2024 15:28:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA0D414E2F4; Thu, 16 May 2024 15:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="iIMabCed"; dkim=pass (1024-bit key) header.d=fluxnic.net header.i=@fluxnic.net header.b="iRF+9Q2q" Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDD9F14D431; Thu, 16 May 2024 15:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.108.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715873296; cv=none; b=miJaGR+OjsK8dAvMFt8YcC/lLIlI1eufYTzDXJ/qwlAZBWD5uaT7dB+eBRDOzNGeaKYhK4RLaxPj/x1hDYoPwgtyapRfQYjkGTAF9BktC4Qg9O4V/QxbNa5xYJgTFh3vM9YJ9QWsCX/Je54MXqQ3J04SOpjCxkpYjQbNBPinH0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715873296; c=relaxed/simple; bh=jDGaIXZ6mwJSE++TssF9Hgd5zL7rRZplsxBJ8LGhBE0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=hNpOUDTOOZkqli2PYjt6g62th3v+IEE1ZwpMw95eAj5bCvLkfcatRmWSOYo4SSY3T4hkN5UrmMA0IeXBjLNL+rESusT+qegiEu2tS+LY5MxbZW7owslwOtyFwz5fg+r10IE6oqsD4gJ8fAOIsEIVU+AIzlo+iVzkT9LBG8h+lRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fluxnic.net; spf=pass smtp.mailfrom=fluxnic.net; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b=iIMabCed; dkim=pass (1024-bit key) header.d=fluxnic.net header.i=@fluxnic.net header.b=iRF+9Q2q; arc=none smtp.client-ip=64.147.108.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fluxnic.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fluxnic.net Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 3CBDD20145; Thu, 16 May 2024 11:28:08 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=date:from :to:cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=jDGaIXZ6mwJSE++TssF9Hgd5zL7rRZplsxBJ8L GhBE0=; b=iIMabCed0OLIq2MSNYAdqqL5B00RDZCoGMHJ+oKGm1jaBCDA2Vjs1w JlD9VLaJuZCyxIj84vW0xKKixfE41XreZbErLJOWgHR/vDlxKaNTNli6E53FrHem 7OaffE4dpQ2+0Zk2ye2TcVDatSbWGz2lFyDNUk6kK0Ia+vo2s3+eM= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 2FC8120144; Thu, 16 May 2024 11:28:08 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=date:from:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type; s=2016-12.pbsmtp; bh=jDGaIXZ6mwJSE++TssF9Hgd5zL7rRZplsxBJ8LGhBE0=; b=iRF+9Q2qWzw2ciruz1uGT5msSsWhWF+t0SqcIAcRKLfKZI9byA9Bg+I+r/KAit9buJxLZgg2E3DkBI9XwJ3eRn5qckpB+unpqs0Dq7Wb1YRAtLRn1BT+0cfTil9AIGZtktisONajvPuVvpYdRidGRvuZcO6iDFcG4+r5/T+nsNA= Received: from yoda.fluxnic.net (unknown [184.162.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 6979020143; Thu, 16 May 2024 11:28:07 -0400 (EDT) (envelope-from nico@fluxnic.net) Received: from xanadu (unknown [IPv6:fd17:d3d3:663b:0:9696:df8a:e3:af35]) by yoda.fluxnic.net (Postfix) with ESMTPSA id 5B3AACAF973; Thu, 16 May 2024 11:28:06 -0400 (EDT) Date: Thu, 16 May 2024 11:28:06 -0400 (EDT) From: Nicolas Pitre To: Thorsten Blum cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Paul Adrian Glaubitz , Arnd Bergmann , Andrew Lunn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH] net: smc91x: Fix pointer types In-Reply-To: <20240516121142.181934-3-thorsten.blum@toblux.com> Message-ID: References: <20240516121142.181934-3-thorsten.blum@toblux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: E5494648-1398-11EF-AF40-25B3960A682E-78420484!pb-smtp2.pobox.com On Thu, 16 May 2024, Thorsten Blum wrote: > Use void __iomem pointers as parameters for mcf_insw() and mcf_outsw() > to align with the parameter types of readw() and writew(). > > Consistently call SMC_outsw(), SMC_outsb(), SMC_insw(), and SMC_insb() > with void __iomem pointers to address the following warnings reported by > kernel test robot: > > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: warning: incorrect type in argument 1 (different address spaces) > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: expected void *a > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: got void [noderef] __iomem * > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: warning: incorrect type in argument 1 (different address spaces) > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: expected void *a > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: got void [noderef] __iomem * > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: warning: incorrect type in argument 1 (different address spaces) > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: expected void *a > drivers/net/ethernet/smsc/smc91x.c:590:9: sparse: got void [noderef] __iomem * > drivers/net/ethernet/smsc/smc91x.c:483:17: sparse: warning: incorrect type in argument 1 (different address spaces) > drivers/net/ethernet/smsc/smc91x.c:483:17: sparse: expected void *a > drivers/net/ethernet/smsc/smc91x.c:483:17: sparse: got void [noderef] __iomem * > > Signed-off-by: Thorsten Blum > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202405160853.3qyaSj8w-lkp@intel.com/ Acked-by: Nicolas Pitre > --- > drivers/net/ethernet/smsc/smc91x.h | 34 +++++++++++++++--------------- > 1 file changed, 17 insertions(+), 17 deletions(-) > > diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h > index 45ef5ac0788a..204fbb5c975c 100644 > --- a/drivers/net/ethernet/smsc/smc91x.h > +++ b/drivers/net/ethernet/smsc/smc91x.h > @@ -142,14 +142,14 @@ static inline void _SMC_outw_align4(u16 val, void __iomem *ioaddr, int reg, > #define SMC_CAN_USE_32BIT 0 > #define SMC_NOWAIT 1 > > -static inline void mcf_insw(void *a, unsigned char *p, int l) > +static inline void mcf_insw(void __iomem *a, unsigned char *p, int l) > { > u16 *wp = (u16 *) p; > while (l-- > 0) > *wp++ = readw(a); > } > > -static inline void mcf_outsw(void *a, unsigned char *p, int l) > +static inline void mcf_outsw(void __iomem *a, unsigned char *p, int l) > { > u16 *wp = (u16 *) p; > while (l-- > 0) > @@ -1026,15 +1026,15 @@ static const char * chip_ids[ 16 ] = { > } \ > } while (0) > > -#define SMC_PUSH_DATA(lp, p, l) \ > +#define SMC_PUSH_DATA(lp, p, l) \ > do { \ > - if (SMC_32BIT(lp)) { \ > + void __iomem *__ioaddr = ioaddr; \ > + if (SMC_32BIT(lp)) { \ > void *__ptr = (p); \ > int __len = (l); \ > - void __iomem *__ioaddr = ioaddr; \ > if (__len >= 2 && (unsigned long)__ptr & 2) { \ > __len -= 2; \ > - SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \ > + SMC_outsw(__ioaddr, DATA_REG(lp), __ptr, 1); \ > __ptr += 2; \ > } \ > if (SMC_CAN_USE_DATACS && lp->datacs) \ > @@ -1042,20 +1042,20 @@ static const char * chip_ids[ 16 ] = { > SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \ > if (__len & 2) { \ > __ptr += (__len & ~3); \ > - SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \ > + SMC_outsw(__ioaddr, DATA_REG(lp), __ptr, 1); \ > } \ > } else if (SMC_16BIT(lp)) \ > - SMC_outsw(ioaddr, DATA_REG(lp), p, (l) >> 1); \ > - else if (SMC_8BIT(lp)) \ > - SMC_outsb(ioaddr, DATA_REG(lp), p, l); \ > + SMC_outsw(__ioaddr, DATA_REG(lp), p, (l) >> 1); \ > + else if (SMC_8BIT(lp)) \ > + SMC_outsb(__ioaddr, DATA_REG(lp), p, l); \ > } while (0) > > -#define SMC_PULL_DATA(lp, p, l) \ > +#define SMC_PULL_DATA(lp, p, l) \ > do { \ > - if (SMC_32BIT(lp)) { \ > + void __iomem *__ioaddr = ioaddr; \ > + if (SMC_32BIT(lp)) { \ > void *__ptr = (p); \ > int __len = (l); \ > - void __iomem *__ioaddr = ioaddr; \ > if ((unsigned long)__ptr & 2) { \ > /* \ > * We want 32bit alignment here. \ > @@ -1072,7 +1072,7 @@ static const char * chip_ids[ 16 ] = { > */ \ > __ptr -= 2; \ > __len += 2; \ > - SMC_SET_PTR(lp, \ > + SMC_SET_PTR(lp, \ > 2|PTR_READ|PTR_RCV|PTR_AUTOINC); \ > } \ > if (SMC_CAN_USE_DATACS && lp->datacs) \ > @@ -1080,9 +1080,9 @@ static const char * chip_ids[ 16 ] = { > __len += 2; \ > SMC_insl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \ > } else if (SMC_16BIT(lp)) \ > - SMC_insw(ioaddr, DATA_REG(lp), p, (l) >> 1); \ > - else if (SMC_8BIT(lp)) \ > - SMC_insb(ioaddr, DATA_REG(lp), p, l); \ > + SMC_insw(__ioaddr, DATA_REG(lp), p, (l) >> 1); \ > + else if (SMC_8BIT(lp)) \ > + SMC_insb(__ioaddr, DATA_REG(lp), p, l); \ > } while (0) > > #endif /* _SMC91X_H_ */ > -- > 2.45.0 > >