Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp2351336qtg; Wed, 22 Mar 2023 22:28:51 -0700 (PDT) X-Google-Smtp-Source: AK7set8BjeiOO/PwKr2EEYcb6C6LV3M1EvO1+s2exIHOW5yb+VfYBH/Sp1fU2UHGolXdLQAsUE3c X-Received: by 2002:a17:902:d486:b0:19a:ad2f:2df9 with SMTP id c6-20020a170902d48600b0019aad2f2df9mr7155304plg.55.1679549331546; Wed, 22 Mar 2023 22:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679549331; cv=none; d=google.com; s=arc-20160816; b=n0Iy04BiwzO1krhgebnmO0jVCw8nDp2XW7gn8XQt2WHgkJwVuvHOAr1Pin2nw++nl/ B6vYvI+8s07Sgp1Z6nfWUGutt6uqc7Gp52dC8w+uNrBRGY18Ach/y4Fqy4S+yWgh9ww7 /2v9TNOyYGhK20nvWIm6kYVPRaQi67YLMP4Y4JcJt1xEUxjwruTHt9fLc6bts1mb2udf njpc1WXvtNnE90RJ3Pyyd4ue0aXRHF7ZaF8MABNjp696yWYtts2PfAzE4TB9EkuLRvbd zol6DaaeaiSwk1DNZDRQlaJbL+Tcu0cQuw3t9zbNMr2N3PlbqPvqKmFF8BnL96+lhYJb wK+g== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ZyLdnOyXZGG0qoN3Re3WJAJkpbQGLSqqxCsQ3tz5THA=; b=E87yLbgfQMSPfpWID6II+kqYEV/Rrh8ZR9ucSCv3RSvlTOe6zWGjvSzQQQT2ygljjl rVuBdslwf2tziK1PD8KHK+Ag+BDIKbYStYtu3AICRaaW7mD+KJsxglKuDLBOQuLNeHRq sE8B6YZBME6n/MOz7xdkjzCQqXSdrY2Kt7c8DSZa4vLAmkhEIEYjEAv2GwrHtp5sfLVX dfw2Ozj2qkRgAqhbB9+GOZBLImHj07kUzCaFZP+krrVZUukxoy3oPXb4AyHxoUzKnnnY RFWhIB0w1w4SMSkCgBOxF3bZw264lJzUJDlS61vugCkL1dI/PWsXYurt2E82jrxmQmiv zx4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Xd8+S/jI"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a170903018e00b001990a6daf9fsi11586709plg.535.2023.03.22.22.28.39; Wed, 22 Mar 2023 22:28:51 -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=@kernel.org header.s=k20201202 header.b="Xd8+S/jI"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbjCWFYJ (ORCPT + 99 others); Thu, 23 Mar 2023 01:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjCWFYH (ORCPT ); Thu, 23 Mar 2023 01:24:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D5B30E7; Wed, 22 Mar 2023 22:24:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EA58AB81EDF; Thu, 23 Mar 2023 05:24:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B178C433EF; Thu, 23 Mar 2023 05:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679549044; bh=xdQEi2T23B51NOtmLtEDnwhGyrXL92E2kjmml3aOZVQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Xd8+S/jIUIfM95b95dyllL8/aA6NwDvroRUD0L5LxTwB/WyCRrc1wm/4g4mjkuchs 4zREMHnIyKMKKmeang2N38wfBrObnHejBosnVO9+oxxxhr12qj1dv1tDBu4LyMFr8t xWJEV1jq/DWD9ev9Kls9dPLYSQ72M531F3CmSYOVciWSnhErNw6Bw9Cx3QaFrnORgm e8V/YKlJ7raptRwbUr0bbsH1oDrOKRqFDKGxnN+gRjTFfyFoSZoHYM/24VYvQ2AZyK JNR+DM6wJkLhz6A7B1vGCyZLrMBejwjaNoCM30tTyukuoJSjbm1zAyBrE1TX5ngMeC pD7OmY+/AyFlg== Date: Wed, 22 Mar 2023 22:24:03 -0700 From: Jakub Kicinski To: Harini Katakam Cc: , , , , , , , , , , Subject: Re: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast Message-ID: <20230322222403.39191060@kernel.org> In-Reply-To: <20230321124005.7014-2-harini.katakam@amd.com> References: <20230321124005.7014-1-harini.katakam@amd.com> <20230321124005.7014-2-harini.katakam@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Mar 2023 18:10:04 +0530 Harini Katakam wrote: > +#ifdef CONFIG_MACB_USE_HWSTAMP > + if (gem_has_ptp(bp)) { > + gem_writel(bp, RXPTPUNI, bottom); > + gem_writel(bp, TXPTPUNI, bottom); > + } > +#endif You can use the same IS_ENABLED() trick here as you used in the if () below, to avoid the direct preprocessor use. In fact why not just add the IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) to the condition inside gem_has_ptp() ? It looks like all callers want that extra check. > + if (IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) && gem_has_ptp(bp)) > + ctrl |= MACB_BIT(PTPUNI);