From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id C58E310E080 for ; Sat, 8 Jul 2023 19:30:36 +0000 (UTC) Date: Sat, 08 Jul 2023 12:30:34 -0700 Message-ID: <871qhii4kl.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Himal Prasad Ghimiray In-Reply-To: <20230707113055.648662-4-himal.prasad.ghimiray@intel.com> References: <20230707113055.648662-1-himal.prasad.ghimiray@intel.com> <20230707113055.648662-4-himal.prasad.ghimiray@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [PATCH i-g-t v8 3/4] tests/xe/xe_guc_pc: Change the sysfs paths List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Upadhyay , igt-dev@lists.freedesktop.org, Badal Nilawar Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Fri, 07 Jul 2023 04:30:54 -0700, Himal Prasad Ghimiray wrote: > diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c > index 827693eb4..e20ab5f88 100644 > --- a/tests/xe/xe_guc_pc.c > +++ b/tests/xe/xe_guc_pc.c > @@ -133,25 +133,38 @@ static void exec_basic(int fd, struct drm_xe_engine_class_instance *eci, > xe_vm_destroy(fd, vm); > } > > -static int set_freq(int sysfs, int gt_id, const char *freq_name, uint32_t freq) > +static int set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq) > { > int ret = -EAGAIN; > - char path[32]; > + char freq_attr[16]; > + int gt_fd; > + > + snprintf(freq_attr, sizeof(freq_attr), "freq_%s", freq_name); > + gt_fd = xe_sysfs_gt_open(fd, gt_id); > + igt_assert(gt_fd != -1); nit: probably doesn't matter and ok as is too, but I'd change this assert to: igt_assert(gt_fd >= 0); Since that's the convention followed in the code. It's there in several places in the file.