Re: [PATCH v4 17/46] tools/lib/traceevent: Man page for tep_read_number()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri,  8 Mar 2019 15:36:25 +0200
Tzvetomir Stoyanov <tstoyanov@xxxxxxxxxx> wrote:

> +struct tep_handle *tep = tep_alloc();
> +...
> +void process_record(struct tep_record *record)
> +{
> +	int data = tep_read_number(tep, record->data, 4);
> +	/* Read the first 4 bytes of the record as integer */

I would use a better example like:

	int offset = 24;
	int data = tep_read_number(tep, record->data + offset, 4);

	/* Read the 4 bytes at the offset 24 of data as an integer */

-- Steve

> +}



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux