Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp50967pxk; Thu, 10 Sep 2020 23:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHQ3zt0swqiCgKQ9nYwvKicc7tjzmEY1N8+2M3nkSgrJKbNTpOM+prQN2bEHTU8/fhXphw X-Received: by 2002:a17:906:364b:: with SMTP id r11mr581885ejb.48.1599805419133; Thu, 10 Sep 2020 23:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599805419; cv=none; d=google.com; s=arc-20160816; b=sdGsfb6z6YaFErttaF2YmNQ9wKTNvVwmSGd42bo5lNPXcIoJAYPn/iKUxhUowduoYf vn1AjXIW/fcRXXUIuzzaGiG649Q21E7+lxK+QJr9qXBlax7f/2GmwAMnE96kQlk9OZnE Nu3VwPZEpY8JGN5eUAKfB8vTPZTHHS84M9T5Zg84X/OvPELTj5ZzXxQ2TzvyDho68vbv vLrFV/s4AQ/pqnvqrmO2JC8+9SJm7nZ0aSHrOP/oT3Fx8xCwXoY2jO9RRB1MMqhZbzs0 J/X2HHdH5ORLstFqs9Sr2iqt2GuaSnyT/nrCxEraxrNESPX8ojfzBo6UNyeFFL/cVchM +CZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JyN/If2kojbsaRcmQiWkZ1r/VAvwIqXGC1TsSQIbyhQ=; b=LSQXy2ANwd7qMIonQwI27vT3GY7Rv7YEy8OK/YwUVk4IwOeomfhetDFXqfDP3bod96 lbjbPhMpljPy9u64EGWOnbO+sk94rwuguiF3tS6p26aYRS+tlXcLQchKeLthSNpjV7y5 SG1gE92SBhlwKTmFfWEKfBAwmffBEhY08kSJfhU2Dh5IBiuqoLnUBAJE9J5P9q4xlikL 3cHH0qhaMcjrRAU8OIjiPCjOB2Nflnd7PPqRTKr/p3l7xnTZGm/vA3kWIexLcAVxd8Ny K97uvghyZD9xLNhC+Lvcnx4oqfzaAg3XN7sLBP/uIxOfBKXMC87OWmCe50Wp7ylrpY5/ J5GA== 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 fx6si566737ejb.432.2020.09.10.23.23.16; Thu, 10 Sep 2020 23:23:39 -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 S1725613AbgIKGVi (ORCPT + 99 others); Fri, 11 Sep 2020 02:21:38 -0400 Received: from verein.lst.de ([213.95.11.211]:35626 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbgIKGVh (ORCPT ); Fri, 11 Sep 2020 02:21:37 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E676E67373; Fri, 11 Sep 2020 08:21:34 +0200 (CEST) Date: Fri, 11 Sep 2020 08:21:34 +0200 From: Christoph Hellwig To: Harald Freudenberger Cc: linux390-list@tuxmaker.boeblingen.de.ibm.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, hch@lst.de, borntraeger@de.ibm.com Subject: Re: [PATCH] s390/zcrypt: remove set_fs() invocation in zcrypt device driver Message-ID: <20200911062134.GB21597@lst.de> References: <20200910102838.28887-1-freude@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200910102838.28887-1-freude@linux.ibm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 10, 2020 at 12:28:38PM +0200, Harald Freudenberger wrote: > +static inline unsigned long z_copy_from_user(bool userspace, > + void *to, const void __user *from, unsigned long n) Can you avoid the pointless long lines in the function declaration? > +{ > + if (likely(userspace)) > + return copy_from_user(to, from, n); > + memcpy(to, (void __force *) from, n); > + return 0; > +} > + > +static inline unsigned long z_copy_to_user(bool userspace, > + void __user *to, const void *from, unsigned long n) > +{ > + if (likely(userspace)) > + return copy_to_user(to, from, n); > + memcpy((void __force *) to, from, n); > + return 0; Otherwise this doesn't look great, but also not horrible and gets rid of the set_fs while reducing the lines of code, so: Reviewed-by: Christoph Hellwig