All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
To: Samuel Li <Samuel.Li-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Xiaojie Yuan <Xiaojie.Yuan-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH libdrm v6 1/1] amdgpu: move asic id table to a separate file
Date: Mon, 5 Jun 2017 11:09:58 +0900	[thread overview]
Message-ID: <416b1697-6e97-9289-f837-dbd504452ec5@daenzer.net> (raw)
In-Reply-To: <1496262170-4222-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org>

On 01/06/17 05:22 AM, Samuel Li wrote:
> From: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
> 
> v2: fix an off by one error and leading white spaces
> v3: use thread safe strtok_r(); initialize len before calling getline();
>     change printf() to drmMsg(); add initial amdgpu.ids
> v4: integrate some recent internal changes, including format changes
> v5: fix line number for empty/commented lines; realloc to save memory; indentation changes
> v6: remove a line error
> 
> Change-Id: I12216da14910f5e2b0970bc1fafc2a20b0ef1ba9
> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
> Signed-off-by: Samuel Li <Samuel.Li@amd.com>

[...]

> +	/* 1st valid line is file version */
> +	while ((n = getline(&line, &len, fp)) != -1) {
> +		/* trim trailing newline */
> +		if (line[n - 1] == '\n')
> +			line[n - 1] = '\0';
> +
> +		/* ignore empty line and commented line */
> +		if (strlen(line) == 0 || line[0] == '#') {
> +			line_num++;
> +			continue;
> +		}
> +
> +		drmMsg("%s version: %s\n", AMDGPU_ASIC_ID_TABLE, line);
> +		break;
> +	}

BTW, what is the purpose of the file version? If it's about the format
of the file, we need to check here that the file has a format we can
parse, something like

	if (<major version> != 1)
		return -EINVAL;


Note that making backwards incompatible changes to the file format would
pretty much kill the idea of updating the file with a script like
update-pciids.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-06-05  2:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 20:22 [PATCH libdrm v6 1/1] amdgpu: move asic id table to a separate file Samuel Li
     [not found] ` <1496262170-4222-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org>
2017-05-31 22:11   ` Alex Deucher
2017-06-05  2:09   ` Michel Dänzer [this message]
     [not found]     ` <416b1697-6e97-9289-f837-dbd504452ec5-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-06-05 16:00       ` Li, Samuel
2017-06-06 13:43   ` Emil Velikov
     [not found]     ` <CACvgo50KM8dvXENsza1ZKbGc_Ww-sDaEVUemKpzjkbsSu+hruQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-07  8:40       ` Michel Dänzer
     [not found]         ` <01541f06-7e21-4fab-2975-d6ad4c4abeb2-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-06-07 11:12           ` Emil Velikov
     [not found]             ` <CACvgo50==aCZTjNPdQREi+KyTiqdSGGax+zhXPUJjStgLACMxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-07 15:20               ` Michel Dänzer
2017-06-12  9:50 ` [PATCH libdrm] " Michel Dänzer
     [not found]   ` <20170612095021.5711-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-06-12 15:48     ` Deucher, Alexander
2017-06-13  9:45     ` [PATCH libdrm v8] " Michel Dänzer
     [not found]       ` <20170613094555.29998-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-06-13 14:31         ` Alex Deucher
2017-06-14 11:34       ` Emil Velikov
     [not found]         ` <CACvgo52rca1jcgzb-or8D48iFsF8NcPP1DemEaOrjfhK0x4Q5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-15  3:16           ` Michel Dänzer
     [not found]             ` <be8496f8-6091-c50e-fa70-332ed937a5c6-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-06-15  7:42               ` Emil Velikov
     [not found]                 ` <CACvgo51i-yEJ_9n82WuG+uRrY3PVcS0SJVYMVeS6SHdC67wRMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-15  8:09                   ` Michel Dänzer
2017-07-04  6:40   ` [PATCH libdrm] " Chih-Wei Huang
2017-07-05  9:35     ` Emil Velikov
     [not found]       ` <CACvgo50fDYbeQey54H2Yn7X=cwnExPPgziQqF2EQu2A79wXqWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-05 10:44         ` Chih-Wei Huang
     [not found]           ` <CAKc24n3iT8mcBmaDM7KDJ_OweVtcyHQi0eCdbB6nFX7im2ffNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-05 11:05             ` Emil Velikov
     [not found]               ` <CACvgo53goXVskuOCMrL3jRjm_+Eh2OzaGh6a9k54aT+ZC=BEDA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-19 10:10                 ` Chih-Wei Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=416b1697-6e97-9289-f837-dbd504452ec5@daenzer.net \
    --to=michel-otuistvhuppr7s880joybq@public.gmane.org \
    --cc=Samuel.Li-5C7GfCeVMHo@public.gmane.org \
    --cc=Xiaojie.Yuan-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.