Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2246782yba; Mon, 22 Apr 2019 03:16:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzC2RHtWo63jUgC3nd+/mKd0FpC3v1h9aV/SLcIrWBsygT9GDV65l+5iL9riEf9dIZAXG22 X-Received: by 2002:aa7:9627:: with SMTP id r7mr19396287pfg.245.1555928174930; Mon, 22 Apr 2019 03:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555928174; cv=none; d=google.com; s=arc-20160816; b=kDcpw9ehGBnfr4qyE6XB4EKROxIYBAIjQd30KMPgdQt1dICX67Fhdy9O9WtrRU9xY3 eNWgQxAk3H25nd2840awJT6veA/AnK8L+uCFprNO92hpkyM+Mxvu5jvUxSZ3Dc/9NidF /m97m0wfKND2YydCq+Y+d/viPANCyGmSk01N4DeMlM5lVux/0OSvnGZQTG6tBwz27QpL iKF05a9Vy52b74lENB/rQpY5u9/ZpGgo2OWPW0F0swWKKAOAdy+DyCvulhs4nA84AKxM bWYI2qIoyMFkCFiab9d2MC/tj9wcE1TDzYH3pw0Y0fCvCaykKEd4z4cGxgNMWfXvfiap HR9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XqVw1qHBd+qzZXzryODfefjrtHfHdjOPzX4oGYHmXtU=; b=YQMTlAQXatQTpflqpulA8pdGJsJqDPzSeKvI+cAXBlz4nI0WF0NcSOoISxMCGF30fp SNyt5ot/CKQuumTTsSV4Mwdkqc235gcBTXVvgI1JRw11de5uCNA1LJblj+UUV2ZcllIw Ss1oCbBxOSSUw/Y6DzxeT8Asib5Lv+upHzvNF+cqZLOhW/7R3K4Qo+ZBeeekwgcWi2PA lV0JKT//iDD9fMT23GCnaTDvVgfTppU6MSoDYL7Dbfz90x9BUnuoFZuDlxbjeJOsi58S NH1vx5yCGSGxMGevRv9IHXhmaEd+vL1/ryGwWc8XOEM3G4zhBDtG5i3ZKPgIcs1tnSTz 9BNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dCoieSXt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si13264588plr.136.2019.04.22.03.15.59; Mon, 22 Apr 2019 03:16:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dCoieSXt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727035AbfDVKOv (ORCPT + 99 others); Mon, 22 Apr 2019 06:14:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbfDVKOu (ORCPT ); Mon, 22 Apr 2019 06:14:50 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D991E206A3; Mon, 22 Apr 2019 10:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555928090; bh=2NDX7a/oF3+wR3ClQPwRoNDywtT9vPrseyn0WaUMBNU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dCoieSXtx0F+k1B5dC08md6B13zWersEtpm2JUXIs3vidCrLdx/nCBcSS+xTShfsk vp2HX83fo+0WUSVPFt/S6WRzGs/vNBYC0HxIR9NYEDMkG7vUO0crWcs12ujWbWOz9i 5leUsoKaQc9/63zLM/bZkEOEyhALZHyFBGQ0aw0E= Date: Mon, 22 Apr 2019 11:14:43 +0100 From: Jonathan Cameron To: Fabrice Gasnier Cc: , , , , , , , , , , , , , , Subject: Re: [PATCH] iio: trigger: stm32-timer: fix build issue when disabled Message-ID: <20190422111443.276572ff@archlinux> In-Reply-To: <1555321642-482-1-git-send-email-fabrice.gasnier@st.com> References: <1555321642-482-1-git-send-email-fabrice.gasnier@st.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Apr 2019 11:47:22 +0200 Fabrice Gasnier wrote: > This fixes a build issue when CONFIG_IIO_STM32_TIMER_TRIGGER isn't set but > used in stm32-dfsdm-adc driver (e.g. CONFIG_STM32_DFSDM_ADC is set): > ERROR: "is_stm32_timer_trigger" [drivers/iio/adc/stm32-dfsdm-adc.ko] > undefined! > > There are two possible options to fix this issue: > - select IIO_STM32_TIMER_TRIGGER along with CONFIG_STM32_DFSDM_ADC. > This is what's being done currently for CONFIG_STM32_ADC. > - stub "is_stm32_timer_trigger" function > > Choice is made to stub this function as suggested in [1]. This is also > inspired by similar "is_stm32_lptim_trigger" function (see [2]) in > include/linux/iio/timer/stm32-lptim-trigger.h > > [1] > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1977377.html > [2] https://lkml.org/lkml/2017/9/10/124 > > Fixes: 11646e81d775 ("iio: adc: stm32-dfsdm: add support for buffer modes") > > Reported-by: Randy Dunlap > Fix-suggested-by: Jonathan Cameron > Signed-off-by: Fabrice Gasnier Hmm. That feels a bit more complex than I was anticipating but fair enough, it seems to cover the combinations. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to have another poke at it. Thanks, Jonathan > --- > include/linux/iio/timer/stm32-timer-trigger.h | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/include/linux/iio/timer/stm32-timer-trigger.h b/include/linux/iio/timer/stm32-timer-trigger.h > index d68add8..cbb7c7a 100644 > --- a/include/linux/iio/timer/stm32-timer-trigger.h > +++ b/include/linux/iio/timer/stm32-timer-trigger.h > @@ -73,6 +73,15 @@ > > #define TIM17_OC1 "tim17_oc1" > > +#if IS_REACHABLE(CONFIG_IIO_STM32_TIMER_TRIGGER) > bool is_stm32_timer_trigger(struct iio_trigger *trig); > - > +#else > +static inline bool is_stm32_timer_trigger(struct iio_trigger *trig) > +{ > +#if IS_ENABLED(CONFIG_IIO_STM32_TIMER_TRIGGER) > + pr_warn_once("stm32-timer-trigger not linked in\n"); > +#endif > + return false; > +} > +#endif > #endif