Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3488139rwe; Mon, 29 Aug 2022 12:50:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pcKLstVTnwxPafaRG4X8VcKTEwNykdc5oy2rcxNKeqF+lgT+XHQ3FGbotFUVPq0dAykjS X-Received: by 2002:a17:90b:3e84:b0:1fd:ce48:979 with SMTP id rj4-20020a17090b3e8400b001fdce480979mr6723076pjb.54.1661802639639; Mon, 29 Aug 2022 12:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661802639; cv=none; d=google.com; s=arc-20160816; b=zFfQ7vQA315ibFkphZ1ErC6QE4IVwurJ8gpLGaSyipzskXGoqRYdCaLRTN5Q9jRvJ+ 56choO5CWuH5X2YOAlHATTk8ADHToaHaWnMlaUvHS8+Wye/710Gu06xFQIgP8HcEXIWL uD8LZHdt8WrxldGdjQ3O16iGNNt0EaZnJA/W1BiG7Yi5hGNYipKN0sSWFjAI5DHoMOka EA/OELSy/TdXFsKm2O2/WXpYl0Y09KZSqOoQFvMKCs1+0E85q+qu5oPgh9M+j5bmpQI8 za9pih36g4SGcJc4qkyte9ySFPFGaJs4Y6dO7bkhLmLMqPc8GkoH4pUiwinC8YkM84BE GNDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pIRa4AL/ga0qHuILPyN2VKLZ3Y5dcsSScu21XOurOb4=; b=IMhtxDMJs2tlblte7MK5zCa9ceF1RZ9cg7m7BwJ1yy3tDy+Bwj+t9o/2oTKTzVuX5R CGxsK7rXPHoKHLx8axZHYqemk0QBZKG+1Wf0+59ZnGsPd0kTJXamQDUktEWBbNZxxQsa 9WaXXUvzE//B0yPJDKV3CpdSFiXZi7JBv4/YUZqUgpF9x1x5auWN1tEo97NO5LoaoD+3 iZF+5Ckg42PBhMOE2z81M5GTggdWJlu7E3qx9u/iPMtzpHSK6yBk6WnwR87u8BBORbrq DvzrDYtvM+xDiBuzhZaXJ5slG5YR/vHC4h2HwPS/P/uKTs08vtuOkhzTeR8z1k6K/cMT /pqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=j5xnVNrZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a14-20020a1709027d8e00b0017293612a07si9122854plm.540.2022.08.29.12.50.29; Mon, 29 Aug 2022 12:50:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=j5xnVNrZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbiH2TrF (ORCPT + 99 others); Mon, 29 Aug 2022 15:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbiH2TrB (ORCPT ); Mon, 29 Aug 2022 15:47:01 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C5B73336 for ; Mon, 29 Aug 2022 12:47:00 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-11e9a7135easo9237261fac.6 for ; Mon, 29 Aug 2022 12:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=pIRa4AL/ga0qHuILPyN2VKLZ3Y5dcsSScu21XOurOb4=; b=j5xnVNrZZHkK2TQd0nhTcCbIu0g1VMB0PQ3Dpe6y36WlzfLHDhWGlLIpm45cV/cpk8 DpBge+ai3ax905WBogMbIuFO+dGnRJx9psvQm8xHVtlT24ifwyJg48+JfYRfyKCPYRAM fcP6zvPrIZJ3+LdOWLxmABorbS6IbUltvkbewlFy4yw/NvBUz5yuLirVtUuL3GXXuhaS WKVlwORVrIfYI0tNCOghGfSe5aBhi8ukxDm2HwkquRcOleo77D/lRujK6bqMHeCXakBK y8SZfXc8X0DfCbDIRFCWBqaJoLLMi3NJVZ/n8a9SO0LU0uuAq8c1yoaaJN9LB30a1aDE PtOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=pIRa4AL/ga0qHuILPyN2VKLZ3Y5dcsSScu21XOurOb4=; b=m3lUXszKEfljruFnK0aI0NZfuuF4juxCo+8ZovlOMXcyEDlrMipibhYL0jcOzfaiA0 QZuNUDQQx99kkV0ZqQo3ERKSVLAzNNObzINDSpo31mDgakKD//vDOEE76BFX+joVevvQ mw2QZdyAQmqyc6wc+iIxmXa54kAxCJ5AYR2OXfTuLPUF2/D6ynA+7hiAqsQupTi6ujSV Ty12qlaijhuU0FPSujxM8uqFg1Tq4/FgIMcjJW4VdbWgUpvjK5v8rZLyraoyw3GKWZ9C xJkQtExWFS7M43Fa7pPnYyKHqV1vxUtNBPTF1PTpanAQg3Uop7QnQ9Cp08z6y6WGQRay Nt9A== X-Gm-Message-State: ACgBeo36PhKxru2sS8683hN2IjadRToo6Yjw2W0ATpUhzCjuwtET4xCR cVRreRoTLscaqsDnFMQP7PxolcIv3nX6R2+QEb8= X-Received: by 2002:a05:6808:138e:b0:345:13d1:fd66 with SMTP id c14-20020a056808138e00b0034513d1fd66mr8077995oiw.96.1661802420177; Mon, 29 Aug 2022 12:47:00 -0700 (PDT) MIME-Version: 1.0 References: <20220829122914.268251-1-cui.jinpeng2@zte.com.cn> In-Reply-To: <20220829122914.268251-1-cui.jinpeng2@zte.com.cn> From: Alex Deucher Date: Mon, 29 Aug 2022 15:46:49 -0400 Message-ID: Subject: Re: [PATCH linux-next] drm/amdkfd: remove redundant variables err and ret To: cgel.zte@gmail.com Cc: Felix.Kuehling@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie, Zeal Robot , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Jinpeng Cui Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Mon, Aug 29, 2022 at 8:29 AM wrote: > > From: Jinpeng Cui > > Return value from kfd_wait_on_events() and io_remap_pfn_range() directly > instead of taking this in another redundant variable. > > Reported-by: Zeal Robot > Signed-off-by: Jinpeng Cui > --- > drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c > index 664e8b5d82c0..84da1a9ce37c 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c > @@ -876,14 +876,11 @@ static int kfd_ioctl_wait_events(struct file *filp, struct kfd_process *p, > void *data) > { > struct kfd_ioctl_wait_events_args *args = data; > - int err; > > - err = kfd_wait_on_events(p, args->num_events, > + return kfd_wait_on_events(p, args->num_events, > (void __user *)args->events_ptr, > (args->wait_for_all != 0), > &args->timeout, &args->wait_result); > - > - return err; > } > static int kfd_ioctl_set_scratch_backing_va(struct file *filep, > struct kfd_process *p, void *data) > @@ -2860,7 +2857,6 @@ static int kfd_mmio_mmap(struct kfd_dev *dev, struct kfd_process *process, > struct vm_area_struct *vma) > { > phys_addr_t address; > - int ret; > > if (vma->vm_end - vma->vm_start != PAGE_SIZE) > return -EINVAL; > @@ -2880,12 +2876,11 @@ static int kfd_mmio_mmap(struct kfd_dev *dev, struct kfd_process *process, > process->pasid, (unsigned long long) vma->vm_start, > address, vma->vm_flags, PAGE_SIZE); > > - ret = io_remap_pfn_range(vma, > + return io_remap_pfn_range(vma, > vma->vm_start, > address >> PAGE_SHIFT, > PAGE_SIZE, > vma->vm_page_prot); > - return ret; > } > > > -- > 2.25.1 >