From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitry V. Levin" Subject: Re: [Intel-gfx] [PATCH v4 2/5] drm: Add private data field to trace control block Date: Mon, 7 Sep 2015 19:51:56 +0300 Message-ID: <20150907165156.GB12658@altlinux.org> References: <1440420170-13337-1-git-send-email-patrik.jakobsson@linux.intel.com> <1440420170-13337-3-git-send-email-patrik.jakobsson@linux.intel.com> <20150825211223.GD12316@vapier> <20150831123707.GA22376@patrik-desktop.isw.intel.com> Reply-To: strace development list Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5342036658050532891==" Return-path: In-Reply-To: <20150831123707.GA22376-mbq0NjRWzOqzCX88HRwER2kA0OJWJZs2VpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: strace-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Patrik Jakobsson Cc: Intel Graphics Development , strace development list List-Id: intel-gfx@lists.freedesktop.org --===============5342036658050532891== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 31, 2015 at 02:37:07PM +0200, Patrik Jakobsson wrote: [...] > Here's my take on it (I assume it needs some discussion): >=20 > int > set_tcb_priv_data(struct tcb *tcp, void *priv_data) > { > /* A free callback is required before setting private data and private > * data must be set back to NULL before being set again. > */ I think a single function initializing both _priv_data and _free_priv_data would suffice: int set_tcb_priv_data(struct tcb *tcp, void *priv_data, void (*free_priv_data)(void *)) { if (tcp->_priv_data) return -1; tcp->_free_priv_data =3D free_priv_data; tcp->_priv_data =3D priv_data; return 0; } --=20 ldv --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXtwKwACgkQfKvmrJ41Nh69TACgx02fv7vV3mflqLIourXeMCOY O2wAoLl8hzoqMIEbhKIvQhYlG9gapE3E =zcfu -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO-- --===============5342036658050532891== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ --===============5342036658050532891== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Strace-devel mailing list Strace-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/strace-devel --===============5342036658050532891==--