From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B30B0C169C4 for ; Fri, 8 Feb 2019 18:27:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2C5E2146E for ; Fri, 8 Feb 2019 18:27:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="EzA3Batz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727532AbfBHS1x (ORCPT ); Fri, 8 Feb 2019 13:27:53 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:44442 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbfBHS1x (ORCPT ); Fri, 8 Feb 2019 13:27:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Rtm3jOxNjMbUtamI0C38MRJj6nSWW4vXhpvZyPoPNhg=; b=EzA3BatzyYbUumiDPXuRFUiZWA JgFw1af3wSw51F0eYOvV3Hwz9PbWjT3jpvemR987yHs2r0CYqYDef1Gs039pEhwR8KACUgyfDOZ1s Ij2vdynkOQzxpyYLCCpfQdZQWNmzqFNVUfQWunlePWeS25NhzyOXXtFy/FaKmkv4eQgg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1gsAsQ-0001h2-2E; Fri, 08 Feb 2019 19:27:50 +0100 Date: Fri, 8 Feb 2019 19:27:50 +0100 From: Andrew Lunn To: Heiner Kallweit Cc: Florian Fainelli , David Miller , "netdev@vger.kernel.org" Subject: Re: [PATCH net-next] net: phy: disregard "Clause 22 registers present" bit in get_phy_c45_devs_in_pkg Message-ID: <20190208182750.GH1853@lunn.ch> References: <47ec59c0-27c0-32e3-c75e-7bdfa99551c9@gmail.com> <20190208140206.GE26594@lunn.ch> <467d5d6b-86d9-2f81-836c-52e17f28bc6c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <467d5d6b-86d9-2f81-836c-52e17f28bc6c@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > >> - *devices_in_package |= (phy_reg & 0xffff); > >> + /* Bit 0 doesn't represent a device, it indicates c22 regs presence */ > >> + *devices_in_package |= (phy_reg & 0xfffe); > > > > Hi Heiner > > > > Just for readability, can we use BIT(0) in there somehow? > > > You think 0xfffe together with the comment is still not clear enough? Hi Heiner It is more i was wondering why the 0xffff was there in the first place. PHY registers are 16 bits. Is this because of a compiler warning? If the use of 0xffff is not obvious, why would 0xfffe be any better. > >> /* Device present registers. */ > >> #define MDIO_DEVS_PRESENT(devad) (1 << (devad)) > >> +#define MDIO_DEVS_C22PRESENT MDIO_DEVS_PRESENT(0) > > > > Err. The commit message says you did not add this... > > > Maybe I'm not clear enough in the commit message. Typically we have two > constants for a device: > > MDIO_MMD_XXX (for the device) > MDIO_DEVS_XXX (for the bit of the device in the device list bitmap) > > For the C22PRESENT flag I don't define the first one (because it's > not a device) but the second one (because it uses a bit in the device > list bitmap). This would be better as a separate patch. It is not used here, and the explanation can then be made clearer. Andrew