From owner-svn-src-all@FreeBSD.ORG Tue Jun 24 06:52:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66E2BFFD; Tue, 24 Jun 2014 06:52:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48A972551; Tue, 24 Jun 2014 06:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5O6qX0M034384; Tue, 24 Jun 2014 06:52:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O6qXuV034383; Tue, 24 Jun 2014 06:52:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406240652.s5O6qXuV034383@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Jun 2014 06:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267814 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 06:52:33 -0000 Author: kib Date: Tue Jun 24 06:52:32 2014 New Revision: 267814 URL: http://svnweb.freebsd.org/changeset/base/267814 Log: Make cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void. There is no error to report. Requested by: attilio Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Tue Jun 24 06:12:11 2014 (r267813) +++ head/sys/dev/cpuctl/cpuctl.c Tue Jun 24 06:52:32 2014 (r267814) @@ -67,9 +67,9 @@ static d_ioctl_t cpuctl_ioctl; static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd, struct thread *td); -static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, +static void cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td); -static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, +static void cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, struct thread *td); static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data, struct thread *td); @@ -171,7 +171,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cm ret = cpuctl_do_msr(cpu, (cpuctl_msr_args_t *)data, cmd, td); break; case CPUCTL_CPUID: - ret = cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td); + cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td); + ret = 0; break; case CPUCTL_UPDATE: ret = priv_check(td, PRIV_CPUCTL_UPDATE); @@ -180,8 +181,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cm ret = cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td); break; case CPUCTL_CPUID_COUNT: - ret = cpuctl_do_cpuid_count(cpu, - (cpuctl_cpuid_count_args_t *)data, td); + cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_count_args_t *)data, + td); + ret = 0; break; default: ret = EINVAL; @@ -194,7 +196,7 @@ fail: /* * Actually perform cpuid operation. */ -static int +static void cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, struct thread *td) { @@ -213,21 +215,18 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cp set_cpu(cpu, td); cpuid_count(data->level, data->level_type, data->data); restore_cpu(oldcpu, is_bound, td); - return (0); } -static int +static void cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td) { cpuctl_cpuid_count_args_t cdata; - int error; cdata.level = data->level; /* Override the level type. */ cdata.level_type = 0; - error = cpuctl_do_cpuid_count(cpu, &cdata, td); + cpuctl_do_cpuid_count(cpu, &cdata, td); bcopy(cdata.data, data->data, sizeof(data->data)); /* Ignore error */ - return (error); } /* @@ -292,12 +291,7 @@ cpuctl_do_update(int cpu, cpuctl_update_ ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); DPRINTF("[cpuctl,%d]: XXX %d", __LINE__, cpu); - ret = cpuctl_do_cpuid(cpu, &args, td); - if (ret != 0) { - DPRINTF("[cpuctl,%d]: cannot retrive cpuid info for cpu %d", - __LINE__, cpu); - return (ENXIO); - } + cpuctl_do_cpuid(cpu, &args, td); ((uint32_t *)vendor)[0] = args.data[1]; ((uint32_t *)vendor)[1] = args.data[3]; ((uint32_t *)vendor)[2] = args.data[2];