Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5163930imm; Tue, 12 Jun 2018 03:44:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJbf7DlgtQ7HHCfoMsfD4Hy5zFFJCkja5150xLY3e1qbNcwEXk6i6ren+LbCTY/fuMJmCV6 X-Received: by 2002:a17:902:5a1:: with SMTP id f30-v6mr3483479plf.167.1528800245528; Tue, 12 Jun 2018 03:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528800245; cv=none; d=google.com; s=arc-20160816; b=0uf1B1I+Md2oTY3K4DB5lYUM4GOsw49a1jmiPdSR9LdObNSf2VdglP8EMNqr3WyydR tKj8MlgSFvmX/9phcOYTj6R7/SzxAxSY4HDoPduWYBNPhs/mp+bryiPjO4uY3i0F2X7u RV2HK81KjHwsDzl8RQli5ApgI+mtcKNx8tbC22d7oaCNInhBQlsXaSwILOLwwlM6kdOR H/vMaQHMRwjMFoQUkKlwHdVECInFio9PMOUKQoh0sZtY2JOcZwAe0vFCpr5AF6VJ4C+W E8gxZXJ6V8cauScJijoZ7ZwMRHJGSn499IH+/clcEEEDOfuWnDhUsJRFrHqNaGX1nkYA 3tmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=jfdEz6HIX60bNCem1hIYEutbWh93nEKvEH3wGgCw99w=; b=eRD/uoaPgUVf4t51RwNarAvhbsIsXmHwBhz/qQdRdcpUHYx6/BSDjuXGdTazXvue42 oJqKmcaD3A/X6v2rKoQ9ftq9Af96q7Sje5KS/6Del8eEyHqf70Oun7Lo0I7LG1zfK1lP m54Ro3rTm/sEl1ihw6zNP2pgSPGP+QRmclU3azt0IzKgt8/HUvqZB81AA2I7y8AerfQA IVpKG2JCWiKwgfe/rS20ItTtO3H/d9wvY7MdguLivEL93F2aVjVkBK7hbf6qff9kaM9Q EERX9PRD2c5fzksIb46FArXfSHWdJNIZmmEaH6Vn/kYxfXh1nScqdRb4nOtMWbDKFUts p/eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qOMwZlI2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16-v6si472451pgq.331.2018.06.12.03.43.51; Tue, 12 Jun 2018 03:44:05 -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=fail header.i=@gmail.com header.s=20161025 header.b=qOMwZlI2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933183AbeFLKnS (ORCPT + 99 others); Tue, 12 Jun 2018 06:43:18 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:42887 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932800AbeFLKnQ (ORCPT ); Tue, 12 Jun 2018 06:43:16 -0400 Received: by mail-lf0-f65.google.com with SMTP id v135-v6so35238053lfa.9; Tue, 12 Jun 2018 03:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jfdEz6HIX60bNCem1hIYEutbWh93nEKvEH3wGgCw99w=; b=qOMwZlI2HHBUxSv2VhjfTwFjKGpaEwPlm0fuXMssm5gG4XC6RRBoMyuHgfXDaLf/Dj +l8WtosO4aQWYumPLm7D8imI9o3gEJ7pD4boN8oD8qTTe9nS9q1gteizFr5b182gXIzI EbjCiRQHkyaWyBmNhG5XyHntq3r+YTdtj0syZb6mm6dvjDHv7o+sB3aBXcF4mhk4q8dX 3cTWRqyS+BOlCOQtyEUzcVl2H3M+wDqJyTGs1v6A/nmRag5u2KRrT87bCllgJm3Lcrob 7nOpWJieFpYy1SxU3OhTE60qtIApotxRVGaHxa2GRPMsOG/MW+xojt/XGerd8LMQ6dpC UM9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=jfdEz6HIX60bNCem1hIYEutbWh93nEKvEH3wGgCw99w=; b=dismxJS8ltpJzSfwHA4s0DUvIn2S+ZRby1QPJ1RUh7+CSemJj0kxPUBxD0GMm1m90i Ar2s27Euk5kviiE8CLTueiWLE5fGdl9HVv3KZLvNByCCvEC4d81fQRrIc/Odeira2Fbu CPjaqkYWztDmkhGCHPdtebGwPKDM+HEcSKUJuCMYSZXLZ5el4LCOvD+jSUItGLAcGxvw xFKsWEn0yldEmtTtfDFKF+/CU0aHvhwGM5O+xYpBx2GBIrBmO/QP/9aXGmAFDDQpvsh0 pjkRi6XkZkWrHsYeAiTS8bVkb7c2pnyY02onZoNgNkG3trfB/09gV31EBkSRe69UteiG fo6g== X-Gm-Message-State: APt69E1dgLgx5tls82ipKDArsHVV0h1R6yQrZvv698EdiInhsGl49fIP KAJIejpLtuco+s2gJcAjy/oMXJjQsXjni91gO1LTUA== X-Received: by 2002:a19:c203:: with SMTP id l3-v6mr1873958lfc.55.1528800195258; Tue, 12 Jun 2018 03:43:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:56c8:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 03:43:14 -0700 (PDT) In-Reply-To: References: <20180525210843.1821071-1-arnd@arndb.de> From: Arnd Bergmann Date: Tue, 12 Jun 2018 12:43:14 +0200 X-Google-Sender-Auth: OPfsCsDihIRDT17PTO5KhYi8YOI Message-ID: Subject: Re: [PATCH] pwm: stm32: fix build warning with CONFIG_DMA_ENGINE disabled To: Geert Uytterhoeven Cc: Thierry Reding , Maxime Coquelin , Alexandre Torgue , Linux PWM List , Linux Kernel Mailing List , Benjamin Gaignard , Fabrice Gasnier , Linux ARM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 9:25 AM, Geert Uytterhoeven wrote: >> --- a/drivers/pwm/pwm-stm32.c >> +++ b/drivers/pwm/pwm-stm32.c >> @@ -484,9 +484,7 @@ static int stm32_pwm_apply_locked(struct pwm_chip *chip, struct pwm_device *pwm, >> static const struct pwm_ops stm32pwm_ops = { >> .owner = THIS_MODULE, >> .apply = stm32_pwm_apply_locked, >> -#if IS_ENABLED(CONFIG_DMA_ENGINE) >> - .capture = stm32_pwm_capture, >> -#endif >> + .capture = IS_ENABLED(CONFIG_DMA_ENGINE) ? stm32_pwm_capture : NULL, > > Cool, I didn't know IS_ENABLED() can be used in static initializers. > I guess it's too late/much work to use this trick in e.g. SET_*_PM_OPS(), > as there are lots of places protecting the functions by #ifdefs? It's one of those things I've been planning to do for a long time, but as you noticed, we can't just change the macro but have to come up with a replacement that works without those #ifdefs. Unfortunately, nobody has come up with a good /name/ for those macros, which is still the main blocker ;-) Arnd