From nobody Tue Nov 26 13:45:41 2024 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58A551D07B0 for ; Thu, 17 Oct 2024 22:08:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729202943; cv=none; b=Ak65NyFzYutgXeRuiyg1O96CpUMvpT8hSt7vyvjTJsmF+roQmhjqnCdz3rIcYimTchIq+6eCK69HX1g4o/m9t9i+4MI5G1RTehNs2IARLUZKSvAvxZTjWNFRW2D21j+oIgJr9WdXolIKPK1NNbpA4rTCiudAVPpwckhLq9NQND8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729202943; c=relaxed/simple; bh=C1ettZhXIGpXrwWmjEv8ZGd6Xkvv0nVVh445vJUf5sk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nSygLcwzzAgjSSrPQNL/Ga6q3d+pJQePnXMuBJTasmyV9JjNMQemlGMlh1WXyKFT2rD2toZYycp7b0hXXhW2kV38oUz38sH6/JnyyYgCCdVWECSa0BWUSYNWeSEsjCwiCd8nui3Ud3+wchbOPATOOxpwmZynxbGL8oNl/TAmy0M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=everestkc.com.np; spf=pass smtp.mailfrom=everestkc.com.np; dkim=pass (2048-bit key) header.d=everestkc-com-np.20230601.gappssmtp.com header.i=@everestkc-com-np.20230601.gappssmtp.com header.b=WdcZHE7n; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=everestkc.com.np Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=everestkc.com.np Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=everestkc-com-np.20230601.gappssmtp.com header.i=@everestkc-com-np.20230601.gappssmtp.com header.b="WdcZHE7n" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-20c7ee8fe6bso13857245ad.2 for ; Thu, 17 Oct 2024 15:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=everestkc-com-np.20230601.gappssmtp.com; s=20230601; t=1729202936; x=1729807736; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UFsgI9iLkr6zyS/OFRJNfMmcc362Y5tywufpoyBtvb4=; b=WdcZHE7nfBmxo7/S5JpX6UH+AemhY8Og1+WV2UIV4mLivj0Qr8CWO+ip8fiCNUK/bJ ZaExwM23sg+CjaxLZ8vj035omFrNWZCFkqmGVjRGAUIlV7tWXA5pTIfiHiwamvrAbAJ1 6enU/uTlfzwZzS+P8/9m5YRV7vKZwVvZ0qm6j4sySWNrh5S0yFU4JV14ew1NyFct/14Y 7f6+CZlGNJtbZS8NQGSgfGDnODMxLYb5ZD+2Z3VPcGVlTiQduA7MRplalqdC+w7KCp/K hlCtL1IgktseT95YII6lvb4SmphtSnj1/FJcpt0AQu3lSksIaUBQvvYQ0OvhZBcKWbEv Q0GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729202936; x=1729807736; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UFsgI9iLkr6zyS/OFRJNfMmcc362Y5tywufpoyBtvb4=; b=Oqa3hayoWwyWTBxK0CQ3QXapBy8gCOVJy+W1iClF6njLmX5GgLFHc8hImoAEyojRcH 593aQR/xMJrOh1NF6dMrbjNOkKL8fDCK4OgAcGFXpROdjXALr543ESvnowi7gYmUt07K /SdMuneBMsqLFffRwMuoOrDglM9/Y4b3cjOOurpZisBpx6Hh4pwKyQ4F3vMDdk0/4xW4 guNfYKYA865082mncyAGRKbv67t6EXtKfxywc5msVDRunLXQN++YH+VstQmJuNcGbAx5 zcdSv0p9SD33Lyqpi5wagoCYyG8ssYzH9UfBHaXgRkarNnNXt+EqcCoTciOYPRQr+T50 HNWw== X-Forwarded-Encrypted: i=1; AJvYcCUT5QP/ChTtdyDLW0zNN2uSuq/gnk36fESEp3dbjWFUBuZroc73EOAQvUNQeZifsWCLXcASo3+A7gu1qXA=@vger.kernel.org X-Gm-Message-State: AOJu0Ywbh7FTj12p+XF1aw6N63hX9OFDUs6EPdEP2w7XjQUhj1SXshgJ 5oudruEOc/CLAS+ZpmaBwg/8zb1QAsE1HhkHgxbj0l5SkKzvBqdsEnG+sYVE0i8= X-Google-Smtp-Source: AGHT+IHCVP3YjOBsb8yQ3gloeSYLh2v91BcMDPYOPuSD9t8hzKslsYpLanvNx3VoPuzhOWozWgRP4Q== X-Received: by 2002:a17:903:120e:b0:20b:8bf5:cd72 with SMTP id d9443c01a7336-20e5a91ac36mr4702555ad.49.1729202936501; Thu, 17 Oct 2024 15:08:56 -0700 (PDT) Received: from localhost.localdomain ([81.17.122.147]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-20e5a8f4c20sm1131545ad.221.2024.10.17.15.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 15:08:56 -0700 (PDT) From: "Everest K.C." To: dpenkler@gmail.com, gregkh@linuxfoundation.org, nathan@kernel.org Cc: "Everest K.C." , skhan@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging: gpib: Change return type and error code of fmh_gpib_get_dma_residue() Date: Thu, 17 Oct 2024 16:07:24 -0600 Message-ID: <20241017220740.30370-1-everestkc@everestkc.com.np> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" fmh_gpib_get_dma_residue() returns unsigned int with -1 as error code. This error cannot be caught. Fix this by changing the return type of the function to int and returning the error code, that was captured. Also, change the data type of variable residue to int in the function fmh_gpib_dma_read(). Fixes: 8e4841a0888c ("staging: gpib: Add Frank Mori Hess FPGA PCI GPIB driv= er") Reported-by: Shuah Khan Signed-off-by: Everest K.C. --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpi= b/fmh_gpib/fmh_gpib.c index 0e27b3ef1a1d..802043ffe684 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -547,7 +547,7 @@ static int fmh_gpib_accel_write(gpib_board_t *board, ui= nt8_t *buffer, return 0; } =20 -static unsigned int fmh_gpib_get_dma_residue(struct dma_chan *chan, dma_co= okie_t cookie) +static int fmh_gpib_get_dma_residue(struct dma_chan *chan, dma_cookie_t co= okie) { struct dma_tx_state state; int result; @@ -555,7 +555,7 @@ static unsigned int fmh_gpib_get_dma_residue(struct dma= _chan *chan, dma_cookie_t result =3D dmaengine_pause(chan); if (result < 0) { pr_err("fmh_gpib_gpib: dma pause failed?\n"); - return -1; + return result; } dmaengine_tx_status(chan, cookie, &state); // dma330 hardware doesn't support resume, so dont call this @@ -717,7 +717,7 @@ static int fmh_gpib_dma_read(gpib_board_t *board, uint8= _t *buffer, struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; int retval =3D 0; unsigned long flags; - unsigned int residue; + int residue; int wait_retval; dma_addr_t bus_address; struct dma_async_tx_descriptor *tx_desc; --=20 2.43.0