Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp969792lqd; Thu, 25 Apr 2024 02:05:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX3wBerwMlANKqUABlKrlgBSqwuumaMH1JPqQP5zzwG8dSDJqnXy51vCr6+ljxKfCtG/nfRYFWFqI3r7L02CD0/5XMPBdl4d4cvqHOs1A== X-Google-Smtp-Source: AGHT+IHdWLibtpxczWagAvfeJhUbBTsrJbttE4+eiwzZWUWWMOaBVL0llley1kj8DPWwbftB4JBw X-Received: by 2002:a17:906:cf89:b0:a55:8820:e8b3 with SMTP id um9-20020a170906cf8900b00a558820e8b3mr3289430ejb.19.1714035918188; Thu, 25 Apr 2024 02:05:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714035918; cv=pass; d=google.com; s=arc-20160816; b=0R6FdCWvMSG+nXJbIb2/q+I3DoyZAkvua3JcJtvOFAp+tdEwKLITMX9d+hfW9dsRP2 Ikg/0JahP2lYl/D8V98kG+oozkPpVPHmoPFsVtzfHkJQJeHTuVbEaURuCwAxfYNm8EkF JIw0ZHPNrP1xjIwbvDqC7Rwa0AjwyBJrZQ7QZS/8VEk+1JU4Za5s50Gpza8qoGmmUS61 YQf9y0WkAe0k0ba5mRV2C3kAGaDgHILjxiAr5eSW3l42bzR2cf6JC5zTgCjpV0jvdlkU bLZYHM5R+abRPuTD+wzxpWQcCuRGv0eW1SV+7djUqA9PjeCPlkszlK12jhHbKHTqycF5 TqAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=F1hRfBkIaXU5ZHxMsQvlQij5N2hNvp7NPW/5Qx5wGGw=; fh=N/7hTtvG3IujHHAb3d8gxTvKaAiA9fq/5RZuNPHvAcY=; b=gNjTaV98+pxUqqq2sDMQmxW8MaDbDs6LXBot21bJG9GodbgKVPei5EychZB5mFWBH7 vqU9u/9uoBAjTQ6WHhumWxDk3yUHWyQ15PE/p/rwo+jVJBjSAtNhi9skEH00Yi5vn+R3 5QqRJG1n7OhAHpccuQ8iPIwY310GfsC+fqtTF79Rdr9vCde7DePEhzQQnikOW5XLjbO4 DvuKIltC9nxVTwOH8GqRcrASHkYreGCYMuHcqEi9je67lpORhvUZjgk/VTrgOh6dfU9S KUiWzYl5cXZddwemJTQ5GcS9RUTHXolYHPldd5oOKQK0DVPqg9/2yRxFg5HdVK+WmSP9 diuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p8GF5ar9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i17-20020a170906251100b00a5214b6a4desi9651811ejb.531.2024.04.25.02.05.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 02:05:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p8GF5ar9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CB3621F24072 for ; Thu, 25 Apr 2024 09:05:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59AD484FCC; Thu, 25 Apr 2024 09:04:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p8GF5ar9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A53684E04; Thu, 25 Apr 2024 09:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714035858; cv=none; b=mvem8MK+b+earJInyomy3wanlQgf9kHq9lQS4wNIcWJxU6urMNpS+9pZf6msvk/mj4+Mx8ltJuh8MzY0gT3wTWXL/VgseecCDTZj4fOER3SqrHcU73HOWj3RXXj+FMvru4rqF4BknFVINwGIbj0O5huj33K8jM/qJXzhBg+Heh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714035858; c=relaxed/simple; bh=shrNbSpov1s6eEL8cOPectBeWnoWaBh+qGBrCjqo5T4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D+K0gVeFYQUjBtu4NBd7Z4yMipS7bBEUpJ14AaiTRR6yY25qkVClZzVK95d1sSANTqMmCY2CVSx3fGeh6Gh5jgLMZVKz27HWorglwKConlqxym7C9hBHkTbysXxajRmEjMDYdOsOSZEpqZtadZkAgQYm7TRso+3FQndbVnrEiIs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p8GF5ar9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A146C113CC; Thu, 25 Apr 2024 09:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714035858; bh=shrNbSpov1s6eEL8cOPectBeWnoWaBh+qGBrCjqo5T4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p8GF5ar9yLaskEOKuKkE9poD8VEe36ZHkjTlVnVHgaSkz7DvZcjv6zethmaP06dSV 6rBbkug81eIUCaB4yWzW02AZcrc5H5nEmFxszUNbpXodSB0G2EH2e6Qw4IecPeGcgz M6he4/IjFg8e9cVcbOa9kiIHrjBQU+zNPO5qcYNsnZMA/wHeJlscTozVjdyj6m60qa epETuoI1JvN/ZP8ouMkEqQMhu36MwX+7WVeJKhvT7pMnBnczcRGysJAshhqbaT9kLt 43FxupTvq16/kb7R67H6yqVftzmfYUnmrC8Q44z8LZhGWQ7IUkXJAAAYrjqt5odxUw lqB6qrNODZfRg== Date: Thu, 25 Apr 2024 14:34:13 +0530 From: Vinod Koul To: Frank Li Cc: Ma Ke , shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, dmaengine@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: mxs-dma: Add check for dma_set_max_seg_size() Message-ID: References: <20240423143205.1420976-1-make_ruc2021@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 24-04-24, 00:07, Frank Li wrote: > On Tue, Apr 23, 2024 at 10:32:05PM +0800, Ma Ke wrote: > > - dma_set_max_seg_size(mxs_dma->dma_device.dev, MAX_XFER_BYTES); > > + ret = dma_set_max_seg_size(mxs_dma->dma_device.dev, MAX_XFER_BYTES); > > + if (ret) > > + return ret; > > How error happen? > > static inline int dma_set_max_seg_size(struct device *dev, unsigned int size) > { > if (dev->dma_parms) { > dev->dma_parms->max_segment_size = size; > return 0; > } > return -EIO; > } > > Only possible dev->dma_parms is null. but mxs-dma is platform device, it > point to platform's dma_parms field. Look like impossible it is null. Yep, checking for the sake of checking is bad. It needs to be logical -- ~Vinod