Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4997784imm; Tue, 12 Jun 2018 00:26:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKfUdKbxxk7fiaGT1sf0FeOMdyLeROswqBiXpYNL5yfZGKkL2SxOepoMJtiqQngM+tFK8s6 X-Received: by 2002:a63:b956:: with SMTP id v22-v6mr2207397pgo.438.1528788385445; Tue, 12 Jun 2018 00:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528788385; cv=none; d=google.com; s=arc-20160816; b=q/RSrrX1iCJfn29PIxPqRYHKV1oaUvCgrlgFJ1+3KaHK1jUQL7R8FspEUj0N1Y3Orv DpM2KFF4fyZqcjxF/tDQ7wXfX4n7rSMeusNuovpoPoJHaA7/pu0X+sqTrt3CBr+4JRyF asTRDfDZ9TTHHn9uCi2si4RRNit70NKJzZuvxiq7MkYK7sOEDtDZ/+QvHWESOuBnLFml nHQzvnWuD0oLwEiAnko6warOKGwq4QEO/W5BEsEcnkFzCVckKvBJgHfTZnxWB1hGk79g q4qaSLNfhTOuUG8b102Tx+hFhBi2JlUvLYdgkO+SG2ORCf+Ybn+Hk8+9PKs+ST56/1uf sIGg== 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 :in-reply-to:references:mime-version:arc-authentication-results; bh=hpuW02e5fz01lQPIGRKiow8oWEu7hE5cx8eVLMb8WYQ=; b=BYEKUjoRb7adQx2B6iLiLANgSjVXJ6L4fCQkyvKa0+ExwLaxV1NTs8K1gIYc3KRg+F KA9/e1Jvf/Vmm3G+agbG/oMKPLJZSa9tgGssmxNCHOiQHOBMSQ4BbVAzEYsF1BHrVO6i sXxoLjh8lFqefMS14EdIAyyxF8NTxmIVsJgIqmRnKRP/taVOSp7uGm54xOKVh1Z70wNY 4z1A5YEJR/kSzKG3kV0jhNIpSG1yW+BQBPSAJmnKR454nvIrfk7HZimVqXi7FHWMe5av 0FNCd0s0eBGA8MWav5qtiDLslAtmzPj4W/89jPD0ayTpR+aXOqeNza2JOTplT5/rAgB+ 2nmg== ARC-Authentication-Results: i=1; mx.google.com; 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 bg1-v6si239886plb.359.2018.06.12.00.26.11; Tue, 12 Jun 2018 00:26:25 -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; 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 S933346AbeFLHZS (ORCPT + 99 others); Tue, 12 Jun 2018 03:25:18 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:46584 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932637AbeFLHZR (ORCPT ); Tue, 12 Jun 2018 03:25:17 -0400 Received: by mail-ua0-f195.google.com with SMTP id d7-v6so674310uam.13; Tue, 12 Jun 2018 00:25:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hpuW02e5fz01lQPIGRKiow8oWEu7hE5cx8eVLMb8WYQ=; b=YP+ew1A6jsYlqnbVCRpopX8OhLW+650FEhzmruSrO/libjIAM/Du/ip6eBJUhDaWnX EXjaJQ5zVugAnVL4ntibrXq3MYEJZ6bLDlENGtZ2hNioYu10zYcMXJeS0dx+a/bJmVJj ZBeH8yfCi8ijVYegy02zdpXCu1Z4QIqxuO20Q6oIOZ3DngzNzrScya4dyGLQjusoQrfk GW8LEk9x1pwTMx84yjJ3ufu7et7rDkEBCXUgWp9amIXxdKaChO44WzSjyjHD1UhxqZer WdHFy4AWe+OfdJ/ne57GK5kqY/IqDkROyhrFJ2qLeOahi0fVmc68ZvPvmNZjeLhD0DhD F/1w== X-Gm-Message-State: APt69E1/zn3o2Rd2GGqbmIvhxQyp0sg1BP33tEMyPfB5U0qRsVDjbaU2 prgFB6yViQVmQEgoUUum14m4Jg3rWuxMsFFuSQo= X-Received: by 2002:ab0:265:: with SMTP id 92-v6mr1741926uas.26.1528788316119; Tue, 12 Jun 2018 00:25:16 -0700 (PDT) MIME-Version: 1.0 References: <20180525210843.1821071-1-arnd@arndb.de> In-Reply-To: <20180525210843.1821071-1-arnd@arndb.de> From: Geert Uytterhoeven Date: Tue, 12 Jun 2018 09:25:05 +0200 Message-ID: Subject: Re: [PATCH] pwm: stm32: fix build warning with CONFIG_DMA_ENGINE disabled To: Arnd Bergmann Cc: Thierry Reding , Maxime Coquelin , Alexandre Torgue , Linux PWM List , Linux Kernel Mailing List , Benjamin Gaignard , fabrice.gasnier@st.com, 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 Hi Arnd, On Fri, May 25, 2018 at 11:09 PM Arnd Bergmann wrote: > Without dmaengine support, we get a harmless warning about an > unused function: > > drivers/pwm/pwm-stm32.c:166:12: error: 'stm32_pwm_capture' defined but not used [-Werror=unused-function] > > Changing the #ifdef to an IS_ENABLED() check shuts up that warning > and is slightly nicer to read. > > Fixes: 53e38fe73f94 ("pwm: stm32: Add capture support") > Signed-off-by: Arnd Bergmann Thanks! Acked-by: Geert Uytterhoeven > --- 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? > }; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds