From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 12/20] drm: drop DRM_DEBUG_CODE Date: Fri, 29 Aug 2014 14:10:26 +0200 Message-ID: <20140829121025.GL17519@ulmo> References: <1409307166-12396-1-git-send-email-dh.herrmann@gmail.com> <1409307166-12396-13-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2051920423==" Return-path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F6B46E6C2 for ; Fri, 29 Aug 2014 05:10:29 -0700 (PDT) Received: by mail-wg0-f49.google.com with SMTP id y10so2032353wgg.20 for ; Fri, 29 Aug 2014 05:10:28 -0700 (PDT) In-Reply-To: <1409307166-12396-13-git-send-email-dh.herrmann@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Herrmann Cc: Daniel Vetter , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============2051920423== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ICrdrp3pM9DyZLTK" Content-Disposition: inline --ICrdrp3pM9DyZLTK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 29, 2014 at 12:12:38PM +0200, David Herrmann wrote: [...] > diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/rad= eon.h > index 83a2461..5cfa574 100644 > --- a/drivers/gpu/drm/radeon/radeon.h > +++ b/drivers/gpu/drm/radeon/radeon.h > @@ -2761,18 +2761,25 @@ void radeon_atombios_fini(struct radeon_device *r= dev); > /* > * RING helpers. > */ > -#if DRM_DEBUG_CODE =3D=3D 0 > + > +/** > + * radeon_ring_write - write a value to the ring > + * > + * @ring: radeon_ring structure holding ring information > + * @v: dword (dw) value to write > + * > + * Write a value to the requested ring buffer (all asics). > + */ > static inline void radeon_ring_write(struct radeon_ring *ring, uint32_t = v) > { > + if (ring->count_dw <=3D 0) > + DRM_ERROR("radeon: writing more dwords to the ring than expected!\n"); > + > ring->ring[ring->wptr++] =3D v; > ring->wptr &=3D ring->ptr_mask; > ring->count_dw--; > ring->ring_free_dw--; > } > -#else > -/* With debugging this is just too big to inline */ > -void radeon_ring_write(struct radeon_ring *ring, uint32_t v); > -#endif > =20 > /* > * ASICs macro. > diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeo= n/radeon_ring.c > index d656079..6f2a9bd 100644 > --- a/drivers/gpu/drm/radeon/radeon_ring.c > +++ b/drivers/gpu/drm/radeon/radeon_ring.c > @@ -45,27 +45,6 @@ > static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct r= adeon_ring *ring); > =20 > /** > - * radeon_ring_write - write a value to the ring > - * > - * @ring: radeon_ring structure holding ring information > - * @v: dword (dw) value to write > - * > - * Write a value to the requested ring buffer (all asics). > - */ > -void radeon_ring_write(struct radeon_ring *ring, uint32_t v) > -{ > -#if DRM_DEBUG_CODE > - if (ring->count_dw <=3D 0) { > - DRM_ERROR("radeon: writing more dwords to the ring than expected!\n"); > - } > -#endif > - ring->ring[ring->wptr++] =3D v; > - ring->wptr &=3D ring->ptr_mask; > - ring->count_dw--; > - ring->ring_free_dw--; > -} The original was clearly never tested with DRM_DEBUG_CODE !=3D 0. I don't see how it could've built given that the header protects the complete function whereas the implementation protects only part of the function. Reviewed-by: Thierry Reding --ICrdrp3pM9DyZLTK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUAG2xAAoJEN0jrNd/PrOh/D4P/jc9Zb/ZIZ4addLyFmuMkeZy 5jmEJS3zipSl9RecaryKxxesgHWTZ4u5wBWXl7JfEjkWCY0pOkB4WKv1uk0ut/7X EY8IKcBwA7lRnpBWfmmgD1H5ahqgxGxtwdA7YOdhbu/SKSudSGxvNZ/wwQOlbd3X /9ruJcff8sFgL5fb8FiKCSyxTjDaaqIGjp88iu6PV7CYs8X3cAmKL0O/18Dx5qei d2h/jZYLOBHiGbQmODn39Dl/KGarPkpZckJiD0IWAfkVOgwvtGcLw6k6C9KmJLgC RdJSNvFx8lEBxujdlYMB19qgEKskdWvj9zGSPwV7I7+CIn4Fe08qTl140OXGCqv6 wudu2E/PLx3w4T/W3rgbUNnKDTctBvx4zDJpv96OMAI9KPn/FoLvZIrZc3DaCqFV JWxWt22aWQPGzGniTp2VSA0qCPyrTSV7CiryqvpGGl7734qtW2ZRnrIEZ/4kBflP UHTrn9dfnSPFvwaup+MITfB4OLpRUfGX40EX1cjRMmtxWP4LUysBs3k8kcJMnPvK puofIXYlgaNhEOMbs9Rm2DBRyxhbuXEiC3x5zXxCbqke9CoHSE/3yXUsWuptMqUq 7lc6PI9PQiPrdwYMEUbtpUcX2HsAEB/eQXWV85zdGHfJYgxrpUyaxvRblY4u4DUp JhGgnxHSLu+uUbk9qRpA =CANe -----END PGP SIGNATURE----- --ICrdrp3pM9DyZLTK-- --===============2051920423== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============2051920423==--