From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752848AbbC0MBj (ORCPT ); Fri, 27 Mar 2015 08:01:39 -0400 Received: from ozlabs.org ([103.22.144.67]:54268 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbbC0MBi (ORCPT ); Fri, 27 Mar 2015 08:01:38 -0400 In-Reply-To: <1421144560-15901-7-git-send-email-khandual@linux.vnet.ibm.com> To: Anshuman Khandual , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org From: Michael Ellerman Cc: mikey@neuling.org, anton@samba.org Subject: Re: [V2,06/12] selftests, powerpc: Add test for system wide DSCR default Message-Id: <20150327120136.EF3431400DE@ozlabs.org> Date: Fri, 27 Mar 2015 23:01:36 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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