From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933336AbcCNCOq (ORCPT ); Sun, 13 Mar 2016 22:14:46 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:40441 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932172AbcCNCOh (ORCPT ); Sun, 13 Mar 2016 22:14:37 -0400 Date: Sun, 13 Mar 2016 22:14:34 -0400 (EDT) Message-Id: <20160313.221434.1980290565680430002.davem@davemloft.net> To: git@karolherbst.de Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 1/2] net/forcedeth: refactor wol support to make it easier to add more wol modes From: David Miller In-Reply-To: <1457621884-2479-2-git-send-email-git@karolherbst.de> References: <1457621884-2479-1-git-send-email-git@karolherbst.de> <1457621884-2479-2-git-send-email-git@karolherbst.de> X-Mailer: Mew version 6.7 on Emacs 24.5 / 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]); Sun, 13 Mar 2016 19:14:37 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Karol Herbst Date: Thu, 10 Mar 2016 15:58:03 +0100 > @@ -4218,8 +4219,9 @@ static void nv_get_wol(struct net_device *dev, struct ethtool_wolinfo *wolinfo) > wolinfo->supported = WAKE_MAGIC; > > spin_lock_irq(&np->lock); > - if (np->wolenabled) > - wolinfo->wolopts = WAKE_MAGIC; > + wolinfo->wolopts = 0; > + if (np->wolenabled & WAKE_MAGIC) > + wolinfo->wolopts |= WAKE_MAGIC; > spin_unlock_irq(&np->lock); > } > When I see a change like this I can see you don't understand the contract that exists between the ethtool core layer and your driver. The command info struct, in this case 'wolinfo' passed to you is zero'd out, always. Therefore the part of the change explicitly clearing out wolinfo->wolopts is completely unnecessary and needs to be removed. Thanks.