Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp166917pxj; Thu, 20 May 2021 06:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkzrNQfSBnhsFc+nGtbFCwMUPL2efiVpqXfGK1W1CySSjGIsxGQulkzgxJRW5895k7FA7r X-Received: by 2002:a05:6402:684:: with SMTP id f4mr5298657edy.25.1621518779626; Thu, 20 May 2021 06:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621518779; cv=none; d=google.com; s=arc-20160816; b=qfLXLqnmWVmx2ombYjN1OhLtpTEYyEvK+CZl3LJ/9Oiw+z4J4W4CNVpv+Zt2bVdkT1 4KmkfFSIz+fSq7g7uMA4My8QGZcQH/rN4GE4hL4bMY8Son39Zo55Owei2Y8yIptG6dk8 8k+sKZjN8Gc0BviQXzUzdgtNrbmyDtvWd3ku11pkH2ePmyymEoaYiFZGVZ40sJfEWhmB yD9p0MVkHlRHygA9ulsPOE5xAxgs/d6MvD4AhvpAk/BOkQIg9ieRgpfw3srUN78sP0Fx xlqdo0cSz9bdZUSPNTf+jr/Pb3fSinJaVJYc0jN3C6heJ0Qp0WMTqCjq6KlxDOFb0mZx WYDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=SEkrD5tpxHU+h/gH/tA5DrHuthzrCDPgMRegllYcsSE=; b=M1anc6jF3p4fOkRZCZHTtkqkMZTuDt3LOcGGLq3FukDX4JSWxkePj8H5peLzus2cBy xu7+FRdLkCtioq7yXZU3+W4wXvuuYW9yOt/g6AtZQlPdgTSa5/gbtrMUvVxE/rP0TK+I BM+Sp5nWpK2W8BOzPBm0a45ODZ1STHoOHFQG/E83+8yjuqavAbXX+E2dtWvtks98ALZr d65FNs8qWiLHIQxXBLztQ86VVuolhWMq0JJ4300SxcEGIdP52RZK1BOUA3WhH6YuU8Y7 8fBx0a3YqAAhOyoN3IYIFaqRQ6pN3XavWMo8EB6u4cPpO1PZoq13eiBZ1XNr1w7R6O3N GNkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si2657327eje.327.2021.05.20.06.52.34; Thu, 20 May 2021 06:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241250AbhETNwG (ORCPT + 99 others); Thu, 20 May 2021 09:52:06 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:46505 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240713AbhETNwE (ORCPT ); Thu, 20 May 2021 09:52:04 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4FmB2n0wrnz9sT8; Thu, 20 May 2021 15:50:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KXyr7xjTL71Y; Thu, 20 May 2021 15:50:41 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4FmB2l2sSMz9sSw; Thu, 20 May 2021 15:50:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4ABDC8B815; Thu, 20 May 2021 15:50:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id rhcQsTtWRX2A; Thu, 20 May 2021 15:50:39 +0200 (CEST) Received: from po15610vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.105]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2E1E28B808; Thu, 20 May 2021 15:50:39 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 23E4C64C40; Thu, 20 May 2021 13:50:39 +0000 (UTC) Message-Id: <2c2123998e05535d08ba03a96ea1eea921d06a86.1621516826.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 02/12] powerpc/inst: Reduce casts in get_user_instr() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , naveen.n.rao@linux.vnet.ibm.com, jniethe5@gmail.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 20 May 2021 13:50:39 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Declare __gui_ptr as 'unsigned int *' instead of casting it at each use. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/inst.h b/arch/powerpc/include/asm/inst.h index 887ef150fdda..57c31e712e67 100644 --- a/arch/powerpc/include/asm/inst.h +++ b/arch/powerpc/include/asm/inst.h @@ -9,16 +9,15 @@ #define ___get_user_instr(gu_op, dest, ptr) \ ({ \ long __gui_ret = 0; \ - unsigned long __gui_ptr = (unsigned long)ptr; \ + unsigned int __user *__gui_ptr = (unsigned int __user *)ptr; \ struct ppc_inst __gui_inst; \ unsigned int __prefix, __suffix; \ \ __chk_user_ptr(ptr); \ - __gui_ret = gu_op(__prefix, (unsigned int __user *)__gui_ptr); \ + __gui_ret = gu_op(__prefix, __gui_ptr); \ if (__gui_ret == 0) { \ if ((__prefix >> 26) == OP_PREFIX) { \ - __gui_ret = gu_op(__suffix, \ - (unsigned int __user *)__gui_ptr + 1); \ + __gui_ret = gu_op(__suffix, __gui_ptr + 1); \ __gui_inst = ppc_inst_prefix(__prefix, \ __suffix); \ } else { \ -- 2.25.0