lkml.org 
[lkml]   [2015]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [V2,06/12] selftests, powerpc: Add test for system wide DSCR default
Date
On Tue, 2015-13-01 at 10:22:34 UTC, Anshuman Khandual wrote:
> This patch adds a test case for the system wide DSCR default
> value, which when changed through it's sysfs interface must
> be visible to all threads reading DSCR either through the
> privilege state SPR or the problem state SPR. The DSCR value
> change should be immediate as well.

...

> +
> +/* Default DSCR access */
> +unsigned long get_default_dscr(void)
> +{
> + int fd = -1;
> + char buf[16];
> + unsigned long val;
> +
> + if (fd == -1) {
> + fd = open(DSCR_DEFAULT, O_RDONLY);
> + if (fd == -1) {
> + perror("open() failed\n");
> + exit(1);
> + }
> + }
> + memset(buf, 0, sizeof(buf));
> + lseek(fd, 0, SEEK_SET);
> + read(fd, buf, sizeof(buf));


This and the other tests are failing to build:

In file included from dscr_default_test.c:16:0:
dscr.h: In function ‘get_default_dscr’:
dscr.h:93:6: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
read(fd, buf, sizeof(buf));
^
dscr.h: In function ‘set_default_dscr’:
dscr.h:112:7: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
write(fd, buf, strlen(buf));
^
cc1: all warnings being treated as errors

cheers


\
 
 \ /
  Last update: 2015-03-27 13:41    [W:0.218 / U:1.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site