From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751021AbdGZEXQ (ORCPT ); Wed, 26 Jul 2017 00:23:16 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:39134 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750747AbdGZEXO (ORCPT ); Wed, 26 Jul 2017 00:23:14 -0400 Date: Tue, 25 Jul 2017 21:23:13 -0700 (PDT) Message-Id: <20170725.212313.1074903864708351840.davem@davemloft.net> To: arnd@arndb.de Cc: mst@redhat.com, jasowang@redhat.com, john.fastabend@gmail.com, willemb@google.com, bigeasy@linutronix.de, edumazet@google.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] virtio-net: mark PM functions as __maybe_unused From: David Miller In-Reply-To: <20170725153600.211694-1-arnd@arndb.de> References: <20170725153600.211694-1-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 25 Jul 2017 21:23:14 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Tue, 25 Jul 2017 17:35:50 +0200 > After removing the reset function, the freeze and restore functions > are now unused when CONFIG_PM_SLEEP is disabled: > > drivers/net/virtio_net.c:1881:12: error: 'virtnet_restore_up' defined but not used [-Werror=unused-function] > static int virtnet_restore_up(struct virtio_device *vdev) > drivers/net/virtio_net.c:1859:13: error: 'virtnet_freeze_down' defined but not used [-Werror=unused-function] > static void virtnet_freeze_down(struct virtio_device *vdev) > > A more robust way to do this is to remove the #ifdef around the callers > and instead mark them as __maybe_unused. The compiler will now just > silently drop the unused code. > > Fixes: 4941d472bf95 ("virtio-net: do not reset during XDP set") > Signed-off-by: Arnd Bergmann Applied, thanks.