From patchwork Fri Nov 29 21:03:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 180503 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2090256ile; Fri, 29 Nov 2019 13:04:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxhJx03/+PTxuOm0pZQCAigBKdrW/6p0JBr0djOPhAJ5XNBWBJQBzmQfZHi7pcUBy1Qg1Pt X-Received: by 2002:adf:fe90:: with SMTP id l16mr7669333wrr.265.1575061473933; Fri, 29 Nov 2019 13:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575061473; cv=none; d=google.com; s=arc-20160816; b=BqS2q3knDJbiDmolrW95sxCDz6xFFeVVszl5Dva8WAgntg2X7ShpDGf1nK3uXj0tb0 8rlzB8KPsVTnVOFAXZxRciE5aLLRlFmr098S7ofR8njXT+jA26Bob71VnBWzmF7akP4/ g093XEXRxyXBwE2ut3aMOHCAYyFoCLv4p7GM1ogFepkyuILxxLE9a/hHuq+g94gvGbpx 4BMyLVYN1rNxzsQ/jrMOc4IwapBTYYV7SHZv66itm0GsbT41KUoSO1TrsnNWryl2Ix90 6foVOiwBmIrGW58lYehLxqPlStQGwxrooYysUbF0Zn5ykicdW8440QFrkHWYamFGwqXp eiAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=AoknaBNUfQvthFfltK6DaxloWZwoEpJbBhDCmjeSwKM=; b=BSgMNw4yZlaRmA/IKGkOJCIyxGuN8BNyeKmBnpW7Axk2sSbeAEcg/EC9dHvLsJrcqH 2hfxzgMBXYFE9hc7PlrvlQ0wehy9v2oED5+Xd5YAm+lY+iOdWnlu6e6/fhIQylab02NE 86Wn88c5/aFQpaoX8JOngmP9pVZ1pU1x+yPU6aiwOKZ2PLuNcIJxWhboKJs/NMj7dUXk 8n7xeU5KjUG7FTsMG5qMNvF+DBSude+bVTVLD8Cq49dXNwxTnOk8EtpEwziWYqlSwHSh Uo+WmAM6p19z7XDK9owRK7xxW3WSDBMubNVd/rIQutre0PiBsASmpWflGecpED69sHkO sm7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lBww4oDn; dkim=pass header.i=@linaro.org header.s=google header.b=oOTA9qU+; spf=pass (google.com: domain of libc-alpha-return-107563-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-107563-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b19si16926858edb.40.2019.11.29.13.04.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Nov 2019 13:04:33 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-107563-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lBww4oDn; dkim=pass header.i=@linaro.org header.s=google header.b=oOTA9qU+; spf=pass (google.com: domain of libc-alpha-return-107563-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-107563-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=oFhFasT1D0ZgJjFUEhNd7iqP8TnSZwH odPRLQU3XzMtwUlJGaOfqj9hWRr5mJfu5ALaOdQI/tLyWx5RvHMCK1o5iuSRodqp 9nAZd1TisKZHxf/yhlVOOVt1dHtg4efu2WRblHQOi5IbGfHG6+nx9xiBBjjX8VVo 0ivIrUbxi1+g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=1wQ9FUeT/c92spl5J2mCM35vAV4=; b=lBww4 oDn7ejioSm53aqxe8fPZ4yOUXty2yeOGoNdX6XmWoXspdX46Kih7B7iiZGKPnXvR IhY7JrbeLu7g90vxVEj9+T8OSysk0II1np9ynzCYyQ/wMHyo1+nsbACcGeQtKkYx McqwRGREVFjwSQNMtzhONfVy18p9b9vuhCaBpA= Received: (qmail 72629 invoked by alias); 29 Nov 2019 21:03:45 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 72574 invoked by uid 89); 29 Nov 2019 21:03:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qk1-f180.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=AoknaBNUfQvthFfltK6DaxloWZwoEpJbBhDCmjeSwKM=; b=oOTA9qU+p2PAPVnYXpVY66AmszOvRXoTKXvCo/1nYx/dPapB2nAJef91FDo4nOkP3Z EjD4+ztRiqEarpooco2iVhgjhdDdTAqRD5by6yZId9dNnQh8RW4LOijT1gtW38ln878o dX83F80KjMJT5Za59jBqNvQEEO/Y4stbGCLzrKcJkEVo3BbVHin8mk6QCFxRI313YMi6 5K9c9BoQI3fgiUUJk71Qz55doOabaZ3UJqVP/68qO9yoJ0yTEaawKaknhi4xVWEhL+rc u1U4YaO2FaBXq0zCXDC/GbsYjKjA2lsh3Jt8ZGfVkS3MrYNUfMJurINqjWKmtL7o3yIi tdpw== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 6/7] linux: Refactor sched_getcpu in terms of getcpu Date: Fri, 29 Nov 2019 18:03:26 -0300 Message-Id: <20191129210327.26434-6-adhemerval.zanella@linaro.org> In-Reply-To: <20191129210327.26434-1-adhemerval.zanella@linaro.org> References: <20191129210327.26434-1-adhemerval.zanella@linaro.org> Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/sched_getcpu.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/sched_getcpu.c b/sysdeps/unix/sysv/linux/sched_getcpu.c index 65dd9fdda7..3646c8b713 100644 --- a/sysdeps/unix/sysv/linux/sched_getcpu.c +++ b/sysdeps/unix/sysv/linux/sched_getcpu.c @@ -17,23 +17,11 @@ #include #include -#include - -#ifdef HAVE_GETCPU_VSYSCALL -# define HAVE_VSYSCALL -#endif -#include int sched_getcpu (void) { -#ifdef __NR_getcpu unsigned int cpu; - int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); - + int r = __getcpu (&cpu, NULL); return r == -1 ? r : cpu; -#else - __set_errno (ENOSYS); - return -1; -#endif }