Message ID | 20230318132708.1684504-1-trix@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp296594wrt; Sat, 18 Mar 2023 06:46:39 -0700 (PDT) X-Google-Smtp-Source: AK7set9Zha0p+Tz57tvDzB7NGcRuT8mPArstIEH8uz1+d0efCMtLH1q355NNsu9vNImGOlWQmC9/ X-Received: by 2002:a62:3889:0:b0:626:178d:a444 with SMTP id f131-20020a623889000000b00626178da444mr5725368pfa.28.1679147198656; Sat, 18 Mar 2023 06:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679147198; cv=none; d=google.com; s=arc-20160816; b=L6D8J8ECqTrq4YbfwdXyTVOFjJFJFa5MmWTzhcRjd8AuIQonDYUZMI5epgIyhkw4/C 0MOtuJOR5Ally+xNw2a/bID5j3C29V5HFn86x1r0q0OMIhZaqZnu21tH1EEQx9oLfOD/ zg98uBWlh4lusUWDiYyvcMWEKCsEzMqdcqDYPIyH3lgtAYz6SjkhmJY0ZLRU4UmawMwp Z5J/ZApkwJCIuPk7jSgTZU0QinCC511lyPMiV2tDoRTnro6oDtEqlXx5YTJi4NmS52sX gt2D39ap9wrnPYEnUbV4wF9gok5EqEqKVhmk2EawXnCQYlmCF7q6VLQ1P5mq8+skyyrZ KK5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UUlLexOxTlL2rJRhRjOGMCzDKj9OAhc0E+V/p5S5fiE=; b=LcKlK1Q262KZ6FVDu9cC29yO5e9re0IC7ICnyYsBpDLULd1eL8PXs21PQthKKnK+J/ XFvFn2YwHT42aI73YYEnj1h/IuT7/wEaaKTq1cyAxWXiDTdQARdP/RilLE4JVlIYoGux zNPK3ppWL/axa6Qmz8Po+SQ+bTq4H8WDB/yStzLFwHup4Es9L+qoE6QoM3uyL/DfaJsK BkIjcCoFmgb4X/urvFe2/HImzNQ4XkiVKH5vSq1LiWlUT+0hgqJiZIfG6pe2f8AnKTTv gj3klwokzk2z/nXGzdNP7qbvqm5bQh17ohpkuhycakw3HRP5o2l7X8RywnLdgK1+EWob v8PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jArS4nr6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m20-20020a056a00165400b006263931f58fsi3413194pfc.348.2023.03.18.06.46.23; Sat, 18 Mar 2023 06:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jArS4nr6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbjCRNck (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sat, 18 Mar 2023 09:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbjCRNcg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 18 Mar 2023 09:32:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E152D303FE for <linux-kernel@vger.kernel.org>; Sat, 18 Mar 2023 06:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679146311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UUlLexOxTlL2rJRhRjOGMCzDKj9OAhc0E+V/p5S5fiE=; b=jArS4nr6mhEG8F7rxxXf7N1prgjFCwNzldcUHAhikbwg3aXjU128BVy8BfEFTchwBHUrcF 84EaoBzFPmocNILireQnOtMxAWqCFL1HKG0kyB1UlE2Mzd7aNSfdwxOwXQ41YIt7KHCpOi DFnXEziTkcgWwMLPiVKV/u8wg/8K/wA= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-8m6LSvLHOcaw01M2B7QReA-1; Sat, 18 Mar 2023 09:31:49 -0400 X-MC-Unique: 8m6LSvLHOcaw01M2B7QReA-1 Received: by mail-qk1-f197.google.com with SMTP id o9-20020a05620a228900b0074585d47b77so3732145qkh.0 for <linux-kernel@vger.kernel.org>; Sat, 18 Mar 2023 06:31:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679146309; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UUlLexOxTlL2rJRhRjOGMCzDKj9OAhc0E+V/p5S5fiE=; b=7WMOkGI4/6hKU/s5fxbE5Wnc27M3IRk+EgGDu2IJwpewa0NREjwlSfnmc0PMeYXb5r k+6acUHZZwUj7bQWmONzV33JM3HQwI0tNaL60a3+vYiysMBC8giMp+8BAPMgCjTAgkZx JlbFMR9Go//h52T8qHA/VF3+/zcIP8ov3Lb/RRMbdUG4WsAprFaBua1zYcMEYrVkXu4F IIMB82AE6+w6jHeYhrEchc3YIi6bD9mUMniNrg2QrbgLS1lcqjJ0lGoNKiUq/SLguu55 sKwkXhOzoUIGrC4L9bHDSpphu1DweaMWEc7fvMmhQ1Sp99NqKuONMjiTAHtEAS4Sv7zd cwQg== X-Gm-Message-State: AO0yUKXGbOMkhwUxzt0qKAmvzmB3+KNZwX90C3COfrYNQvgDhm1vzvJ+ 7oBwsJ55bb1raGjAqC5ppvrPlpxJTbQQDlNu7q9ImAq6uyj8RF/nCTxENYyw2fSGnXdpMFqEElE OO5RDoRml6jiviwQgnZgCtUWV X-Received: by 2002:a05:6214:5281:b0:56e:bc62:e151 with SMTP id kj1-20020a056214528100b0056ebc62e151mr46569157qvb.7.1679146309201; Sat, 18 Mar 2023 06:31:49 -0700 (PDT) X-Received: by 2002:a05:6214:5281:b0:56e:bc62:e151 with SMTP id kj1-20020a056214528100b0056ebc62e151mr46569138qvb.7.1679146309006; Sat, 18 Mar 2023 06:31:49 -0700 (PDT) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id p16-20020a05620a057000b00746476405bbsm3566936qkp.122.2023.03.18.06.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 06:31:48 -0700 (PDT) From: Tom Rix <trix@redhat.com> To: perex@perex.cz, tiwai@suse.com, nathan@kernel.org, ndesaulniers@google.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Tom Rix <trix@redhat.com> Subject: [PATCH] ALSA: ymfpci: remove unused snd_ymfpci_readb function Date: Sat, 18 Mar 2023 09:27:08 -0400 Message-Id: <20230318132708.1684504-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760713453025960133?= X-GMAIL-MSGID: =?utf-8?q?1760713453025960133?= |
Series |
ALSA: ymfpci: remove unused snd_ymfpci_readb function
|
|
Commit Message
Tom Rix
March 18, 2023, 1:27 p.m. UTC
clang with W=1 reports
sound/pci/ymfpci/ymfpci_main.c:34:18: error:
unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function]
static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset)
^
This static function is not used, so remove it.
Signed-off-by: Tom Rix <trix@redhat.com>
---
sound/pci/ymfpci/ymfpci_main.c | 5 -----
1 file changed, 5 deletions(-)
Comments
On Sat, 18 Mar 2023 14:27:08 +0100, Tom Rix wrote: > > clang with W=1 reports > sound/pci/ymfpci/ymfpci_main.c:34:18: error: > unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function] > static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) > ^ > This static function is not used, so remove it. > > Signed-off-by: Tom Rix <trix@redhat.com> I applied now, but still wondering why it warns at all even if it's a static inline function... thanks, Takashi > --- > sound/pci/ymfpci/ymfpci_main.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c > index c80114c0ad7b..2858736ed20a 100644 > --- a/sound/pci/ymfpci/ymfpci_main.c > +++ b/sound/pci/ymfpci/ymfpci_main.c > @@ -31,11 +31,6 @@ > > static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip); > > -static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) > -{ > - return readb(chip->reg_area_virt + offset); > -} > - > static inline void snd_ymfpci_writeb(struct snd_ymfpci *chip, u32 offset, u8 val) > { > writeb(val, chip->reg_area_virt + offset); > -- > 2.27.0 >
On Sun, Mar 19, 2023 at 09:09:22AM +0100, Takashi Iwai wrote: > On Sat, 18 Mar 2023 14:27:08 +0100, > Tom Rix wrote: > > > > clang with W=1 reports > > sound/pci/ymfpci/ymfpci_main.c:34:18: error: > > unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function] > > static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) > > ^ > > This static function is not used, so remove it. > > > > Signed-off-by: Tom Rix <trix@redhat.com> > > I applied now, but still wondering why it warns at all even if it's a > static inline function... See commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build") for some more information. The key part of the commit message is 'with W=1', this will not happen with a normal clang build. Cheers, Nathan > > --- > > sound/pci/ymfpci/ymfpci_main.c | 5 ----- > > 1 file changed, 5 deletions(-) > > > > diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c > > index c80114c0ad7b..2858736ed20a 100644 > > --- a/sound/pci/ymfpci/ymfpci_main.c > > +++ b/sound/pci/ymfpci/ymfpci_main.c > > @@ -31,11 +31,6 @@ > > > > static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip); > > > > -static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) > > -{ > > - return readb(chip->reg_area_virt + offset); > > -} > > - > > static inline void snd_ymfpci_writeb(struct snd_ymfpci *chip, u32 offset, u8 val) > > { > > writeb(val, chip->reg_area_virt + offset); > > -- > > 2.27.0 > >
On 3/19/23 4:34 PM, Nathan Chancellor wrote: > On Sun, Mar 19, 2023 at 09:09:22AM +0100, Takashi Iwai wrote: >> On Sat, 18 Mar 2023 14:27:08 +0100, >> Tom Rix wrote: >>> clang with W=1 reports >>> sound/pci/ymfpci/ymfpci_main.c:34:18: error: >>> unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function] >>> static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) >>> ^ >>> This static function is not used, so remove it. >>> >>> Signed-off-by: Tom Rix <trix@redhat.com> >> I applied now, but still wondering why it warns at all even if it's a >> static inline function... > See commit 6863f5643dd7 ("kbuild: allow Clang to find unused static > inline functions for W=1 build") for some more information. The key part > of the commit message is 'with W=1', this will not happen with a normal > clang build. IMO from this general cleanup, being at W=1, is the correct location. There many functions that could be removed and some that should not be. Tom > > Cheers, > Nathan > >>> --- >>> sound/pci/ymfpci/ymfpci_main.c | 5 ----- >>> 1 file changed, 5 deletions(-) >>> >>> diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c >>> index c80114c0ad7b..2858736ed20a 100644 >>> --- a/sound/pci/ymfpci/ymfpci_main.c >>> +++ b/sound/pci/ymfpci/ymfpci_main.c >>> @@ -31,11 +31,6 @@ >>> >>> static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip); >>> >>> -static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) >>> -{ >>> - return readb(chip->reg_area_virt + offset); >>> -} >>> - >>> static inline void snd_ymfpci_writeb(struct snd_ymfpci *chip, u32 offset, u8 val) >>> { >>> writeb(val, chip->reg_area_virt + offset); >>> -- >>> 2.27.0 >>>
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index c80114c0ad7b..2858736ed20a 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -31,11 +31,6 @@ static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip); -static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) -{ - return readb(chip->reg_area_virt + offset); -} - static inline void snd_ymfpci_writeb(struct snd_ymfpci *chip, u32 offset, u8 val) { writeb(val, chip->reg_area_virt + offset);