Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp756741rdb; Thu, 22 Feb 2024 20:55:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWEF1vMdg60viRhWMkrGuFoB3Oc3MbAAq8jNciQ5DQg3TN0AHi6S24DHzeFalpj4An09CPA7bDvjADpc7URJFuaFWoibtzxWTzAbQUhVw== X-Google-Smtp-Source: AGHT+IGTONSkX97JhlDDxnW29TdsYyNFjyXDv7muFPRgrxcIvRLOAhPals07YMb91EmVCiHKXbMt X-Received: by 2002:a05:6a20:d805:b0:19a:43b9:d460 with SMTP id iv5-20020a056a20d80500b0019a43b9d460mr990450pzb.62.1708664158989; Thu, 22 Feb 2024 20:55:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708664158; cv=pass; d=google.com; s=arc-20160816; b=fDB5iNRkBHY1fr0i3Pgd2EOUureCo4aeOToyjAvWKMQOOpq3JN1XQtZGEmW90f6tLu ZJRJTrVLdlIR9c4sGno3ULz5epD501CNbQvUAR4O7yrXB+W3tjnKw3eRmsON0RFqJiAN zmqMECsI19UnjriIke9fW8bUdmubn+nwvjalYxK70tMy+hyv7D7MiS1ZQGK6tmjrELx6 8hwJgSA0fVmrSAfxXH2Z7ka00n3FBqUlgi5xUGMlpzCPb0DhZF/4PfR4q7R/b3CRouiK Dgjt6eZdm6a2qnhen2bsU3GE4hUhmsxVm5lNslKgSOP8lClXfm1rXNe0dGV7mKKSLfa8 DcTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=nzn6qhouWl6Ny8thgDNGj3TMBZ13piSnRUtxxDtRoE8=; fh=Xuk6GVm6nqAvrA1rla7k0h8W5nDvBokC8AAf4TNrFkA=; b=rwFCvIBrb9Vyd3KgJZC7171yB4YDT4RzGMGQ0zMG/EOtjR99HfbvYxcCBpapFJlNjR 4mcHioeJCDL3pcCIsUZyzjY7kacWoLG3ICD2A3aOH69FrP+7uegniwE0gvBi+4qecqFc BchGCNu2ZBpOUB0Ss3YfwIoHGhpZiOkpevK2hgKLqIJxd4zfMvBydYaCKEGYRbaMyiGg NBfxztpoPUinzrxX5yhzVIl/gKaFmorEhEgg2sOO76bjs0UJ6eAA6Rr6t99GokrAclHp ywQtSK2MM0EHl6UoJQlZsmKOcbRainn0mLnDP2HpAYpZBeJLePfbMAJdCg0PVOIZG8Z0 mvMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=JwhKpcSi; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-77730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id sh12-20020a17090b524c00b002994aca0f01si533406pjb.39.2024.02.22.20.55.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 20:55:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=JwhKpcSi; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-77730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0CBE1B24BAD for ; Fri, 23 Feb 2024 03:49:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B40E311C80; Fri, 23 Feb 2024 03:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="JwhKpcSi" Received: from relay.smtp-ext.broadcom.com (unknown [192.19.166.228]) (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 2100110A1E for ; Fri, 23 Feb 2024 03:48:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.166.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708660111; cv=none; b=J3+DKLaE1d3JC++VpbwStp76/fD9W5XNn1vKnoB4YKzeD5ifVr8rIdDrhgELCJChPlcuenPxJhg3XhkbEaNNzsyesjxN19gSuxZrdDh/cqUIhz0Uc1owGu6N2RFN26qS10kg45EWur3KpwNNW9qFsstUBiiC7w1PyFQGnq9CJig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708660111; c=relaxed/simple; bh=TeVtdX37iglXRJatw6wyyl1lRRIAsFqkPmZrbmC3too=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bLgBPB9cXtkrPlNHznYA0YgxWM6apsMLhXHTejqZZ6EqvIAsTVIM+Cjru8OyVa2g7cTka2T1IEQRQAqtdfF2xicUVqPx+W12GWK2xdpT2WkgZV8iD5Mqj3ykjMHglZR7UX+IvITy2xcNIC51oET6N2vz5/20qa+tvMquy54qqQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=JwhKpcSi; arc=none smtp.client-ip=192.19.166.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 59FABC0047EF; Thu, 22 Feb 2024 19:48:20 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 59FABC0047EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1708660100; bh=TeVtdX37iglXRJatw6wyyl1lRRIAsFqkPmZrbmC3too=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JwhKpcSil3kvONwj/g5TRzwPhwrMvWACFghJl2BckzNhcgRjAjdtJarBx2pQMOwe5 h82PSr+5yESiHsa5oZ5WxRv4TvhJP9iY1RXJRCt4qNM4CDWPWZFasa9HGfDRFr6C+4 adxPHUaANr1AwZ/I/zwIuyCGUQZkHiZI/++IltRs= Received: from bcacpedev-irv-3.lvn.broadcom.net (bcacpedev-irv-3.lvn.broadcom.net [10.173.232.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id CBC1F18041CAC4; Thu, 22 Feb 2024 19:48:18 -0800 (PST) From: William Zhang To: Linux MTD List , Linux ARM List , Broadcom Kernel List Cc: f.fainelli@gmail.com, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, David Regan , Dan Carpenter , William Zhang , Miquel Raynal , linux-kernel@vger.kernel.org, Vignesh Raghavendra , Brian Norris , Richard Weinberger Subject: [PATCH v6 01/13] mtd: rawnand: brcmnand: exec_op helper functions return type fixes Date: Thu, 22 Feb 2024 19:47:46 -0800 Message-Id: <20240223034758.13753-2-william.zhang@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240223034758.13753-1-william.zhang@broadcom.com> References: <20240223034758.13753-1-william.zhang@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: David Regan Fix return types for exec_op reset and status helper functions. Reported-by: Dan Carpenter Closes: http://lists.infradead.org/pipermail/linux-mtd/2023-December/102423.html Fixes: 3c8260ce7663 ("mtd: rawnand: brcmnand: exec_op implementation") Signed-off-by: David Regan Signed-off-by: William Zhang Reviewed-by: William Zhang --- Changes in v6: - Moved style fixes to a separate patch Changes in v5: None Changes in v4: - Fix the commit id in the fixes tag Changes in v3: None Changes in v2: - Added to patch series drivers/mtd/nand/raw/brcmnand/brcmnand.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 8faca43ae1ff..b8e70fc64348 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -625,7 +625,7 @@ enum { /* Only for v7.2 */ #define ACC_CONTROL_ECC_EXT_SHIFT 13 -static u8 brcmnand_status(struct brcmnand_host *host); +static int brcmnand_status(struct brcmnand_host *host); static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl) { @@ -1690,7 +1690,7 @@ static int brcmnand_waitfunc(struct nand_chip *chip) INTFC_FLASH_STATUS; } -static u8 brcmnand_status(struct brcmnand_host *host) +static int brcmnand_status(struct brcmnand_host *host) { struct nand_chip *chip = &host->chip; struct mtd_info *mtd = nand_to_mtd(chip); @@ -1701,7 +1701,7 @@ static u8 brcmnand_status(struct brcmnand_host *host) return brcmnand_waitfunc(chip); } -static u8 brcmnand_reset(struct brcmnand_host *host) +static int brcmnand_reset(struct brcmnand_host *host) { struct nand_chip *chip = &host->chip; @@ -2433,7 +2433,11 @@ static int brcmnand_exec_op(struct nand_chip *chip, if (brcmnand_op_is_status(op)) { status = op->instrs[1].ctx.data.buf.in; - *status = brcmnand_status(host); + ret = brcmnand_status(host); + if (ret < 0) + return ret; + + *status = ret & 0xFF; return 0; } -- 2.37.3