Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4953579ybv; Tue, 11 Feb 2020 06:29:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxf/RSeQwl5bpQJNoSbZN2ShRU0gmryC9NF7kCZuh6uQSeDWm4xqTbl194Xxc+4ukkrEEj3 X-Received: by 2002:a05:6808:99c:: with SMTP id a28mr2897494oic.164.1581431352859; Tue, 11 Feb 2020 06:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581431352; cv=none; d=google.com; s=arc-20160816; b=te2EUHDruws+szAZbZpa1KCy4AXcNV0Hnj9puqNQIn1GkXqxpK7YU7mXVKnu35uW/7 pG6y1j6oV/LqNx4VNh735BNiVHhvET71u29sUkXR63g0xnTddj6uiZvo6+ippZORxfXs SNy21Y9kSVDgTjdZnXM6OKyf40xbqY1vrCP13ZlaezwczAFeNxw2VS9VmWOzpzKx1blu OU9b1P0aAtbCt7ninAMcCp1QLP+0rEwGvNa9ph3CS+AArEJZQ3xBc5DqQyKo42yllFrv kEjvxVMABysU40M4ZCvOTyZqNHVQO7ce3XVPblLuNwTBMSgSUG1kGXFMlsikf5pDRuwi CZlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=TOX8lvEVyyv5CBz2AKG5+XPBWisOWQYMrhEqAOahrw8=; b=FZNBuFJC7Mds4pnO2xC4K8gwtOcehIsLY6Hro1ojgCiO0waY0H4442AzZOT49glVDz E0bzNSeuan+3O2LZZC2WR/DThpRTgSvZe1j+LkuSi2NKeeSIPkz5v++YeBykHaH3ZlhF i8YQoTZF3gkxq+EwB8jD61lm0yD+jlS80ue5QGmJfhwRmh3RPy4YNOb/dzWInHl6KJJ9 Q0bpyp5vvT746x5EMAFgia9Yak5SLNR2RF4gePARozzmTsJY2FraEZLg0dmrlqzBMRKv 5Iu80KgqREBPKQyGBD/+ef7zGSgNYAggs6L0UiBHFK0tHqUYlFY+xSo9RTXhZEyqDw6i Mkyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si2062363otk.218.2020.02.11.06.29.01; Tue, 11 Feb 2020 06:29:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729344AbgBKODj (ORCPT + 99 others); Tue, 11 Feb 2020 09:03:39 -0500 Received: from mga12.intel.com ([192.55.52.136]:6535 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728434AbgBKODj (ORCPT ); Tue, 11 Feb 2020 09:03:39 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 06:03:37 -0800 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="226511538" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.161]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 06:03:34 -0800 From: Jani Nikula To: Wambui Karuga , joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch Cc: sean@poorly.run, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 01/12] drm/i915/dp: convert to struct drm_device based logging macros. In-Reply-To: <20200206080014.13759-2-wambui.karugax@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200206080014.13759-1-wambui.karugax@gmail.com> <20200206080014.13759-2-wambui.karugax@gmail.com> Date: Tue, 11 Feb 2020 16:03:31 +0200 Message-ID: <87o8u5z0ek.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 06 Feb 2020, Wambui Karuga wrote: > @@ -5990,11 +6040,13 @@ int intel_dp_hdcp_write_an_aksv(struct intel_digital_port *intel_dig_port, > static int intel_dp_hdcp_read_bksv(struct intel_digital_port *intel_dig_port, > u8 *bksv) > { > + struct intel_dp *intel_dp = &intel_dig_port->dp; > ssize_t ret; > ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, DP_AUX_HDCP_BKSV, bksv, > DRM_HDCP_KSV_LEN); > if (ret != DRM_HDCP_KSV_LEN) { > - DRM_DEBUG_KMS("Read Bksv from DP/AUX failed (%zd)\n", ret); > + drm_dbg_kms(&dp_to_i915(intel_dp)->drm, > + "Read Bksv from DP/AUX failed (%zd)\n", ret); > return ret >= 0 ? -EIO : ret; > } If you're introducing local variables just for logging, I would prefer it to be i915. struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev); ... drm_dbg_kms(&i915->drm, ...); If you look at dp_to_i915() it actually converts intel_dp back to intel_digital_port, and then does the above to it, to get at i915. This is an unnecessary dance. It's fine to use &dp_to_i915(intel_dp)->drm when there are only a couple of logging calls in a function, and intel_dp is already there. But any more than that, and I'd add the i915 local variable. For example, but not limited to, intel_dp_handle_test_request() would benefit from i915 local var. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center