From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39C91C433EF for ; Sun, 27 Mar 2022 14:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230381AbiC0Ov2 (ORCPT ); Sun, 27 Mar 2022 10:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbiC0Ov1 (ORCPT ); Sun, 27 Mar 2022 10:51:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0054F4091F for ; Sun, 27 Mar 2022 07:49:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 11C25B80BEC for ; Sun, 27 Mar 2022 14:49:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BFD9C340EC; Sun, 27 Mar 2022 14:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648392584; bh=SNTTSseWk+lxTtx4lZbxlGpWHAzNNJsy6qL6vT1+8e8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TZ+S6X2ar+fSKveCY3w3SywZUr+6RFnVjL8ErYeHfX5npO7EGApNaCSHnEC4pCo71 0XfnbCaJRfGAT2nH9gs39eEy9A6p8Mxeo7DcyAHMcYmeCiGrksi7D04bFaV2zx4Gaf NNE7y9/WuU6NlWV/sk4Kzm2GjJRLcGvUu11EdajPxGw968SUIvf5NhW4ABuo3v4oKb sG/9/OeiS/QOV71BhGKHZwSgk93p/VxNzech0JcSTCTEAojt5rAcF7foGHQ+63vzUp MXwSCjtWpTSdcjwc93TpQ/BBXwkGLnew7/5TeBFt5YC8y0IJtEuBsw2CaYuqABUPjm ecdJO/k48ZKqg== Date: Sun, 27 Mar 2022 15:57:18 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Jackie Liu , Jonathan Cameron , linux-iio Subject: Re: [PATCH] iio: adc: da9150-gpadc: fix build on mips CONFIG_MIKROTIK_RB532=y Message-ID: <20220327155718.0d00be25@jic23-huawei> In-Reply-To: References: <20220324055821.3184872-1-liu.yun@linux.dev> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Thu, 24 Mar 2022 12:18:14 +0200 Andy Shevchenko wrote: > On Thu, Mar 24, 2022 at 7:58 AM Jackie Liu wrote: > > > > From: Jackie Liu > > > > kernel robot report build fail by randconfig: > > > > [...] > > drivers/iio/adc/da9150-gpadc.c:254:13: error: =E2=80=98DA9150_GPADC_CHA= N_0x08=E2=80=99 undeclared here (not in a function); did you mean =E2=80=98= DA9150_GPADC_CHAN_TBAT=E2=80=99? > > 254 | .channel =3D DA9150_GPADC_CHAN_##_id, \ > > | ^~~~~~~~~~~~~~~~~~ > > drivers/iio/adc/da9150-gpadc.c:273:2: note: in expansion of macro =E2= =80=98DA9150_GPADC_CHANNEL=E2=80=99 > > 273 | DA9150_GPADC_CHANNEL(_id, _hw_id, _type, \ > > | ^~~~~~~~~~~~~~~~~~~~ > > drivers/iio/adc/da9150-gpadc.c:281:2: note: in expansion of macro =E2= =80=98DA9150_GPADC_CHANNEL_PROCESSED=E2=80=99 > > 281 | DA9150_GPADC_CHANNEL_PROCESSED(GPIOD, GPIOD_6V, IIO_VOLTAGE, N= ULL), > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 >=20 > > make[4]: *** [../scripts/Makefile.build:288: drivers/iio/adc/da9150-gpa= dc.o] Error 1 > > make[3]: *** [../scripts/Makefile.build:550: drivers/iio/adc] Error 2 > > make[3]: *** Waiting for unfinished jobs.... > > [...] =20 >=20 > These lines are noise and no need to be in the commit message. >=20 > > +/* > > + * Workaround for arch/mips/include/asm/mach-rc32434/rb.h > > + * #define GPIOD 0x08 > > + */ > > +#undef GPIOD =20 >=20 > Looking at the bottom here the better approach seems to be namespacing > of GPIO registers in the above mentioned header and corresponding > users. Agreed. Having around it here is just going to the tip of the iceberg long term. The header + users need fixing if it's going to be widely enough included that we can see it in places like this. =46rom some very basic grepping I 'suspect' you could just push the defines down into arch/mips/rb532/gpio.c but I may well be wrong... Jonathan >=20 > > /* Supported channels */ > > static const struct iio_chan_spec da9150_gpadc_channels[] =3D { > > DA9150_GPADC_CHANNEL_PROCESSED(GPIOA, GPIOA_6V, IIO_VOLTAGE, NU= LL), =20 >=20