From patchwork Wed Feb 7 20:22:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 198132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2581442dyb; Wed, 7 Feb 2024 16:05:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVD3r4JehrG061TZ5vFmTFFzlrFylRx55/VhYIwviqWn1PjYFBvUkgDwAz5zY3ltyhKEcMJfTA/k5wwhWdV7tj1o1XGaA== X-Google-Smtp-Source: AGHT+IFioMBHm8PeObQVX9jD1Am1RAr4EMYAbTZH6WrpgG4PRyDuH9faN7Az7gQ8mm1DQ7SbZY/T X-Received: by 2002:a05:6214:500a:b0:68c:ae6d:2959 with SMTP id jo10-20020a056214500a00b0068cae6d2959mr9274379qvb.26.1707350708086; Wed, 07 Feb 2024 16:05:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707350708; cv=pass; d=google.com; s=arc-20160816; b=HwFt6KPupZIL+AweHQRrLu0ah4LYq8OH4RuXKf951oduMBEGnhqDwI9D0Nls8RPDGK zIv3PIY6GmZ/6qBFztT5ghoFJZMG0p2HkW3s+Mimysi6CQ/AeHJy8gPRhVlzzdCeeHTH c8Ns4UIQQKpvFPp4Y/LfBuj3JjDGozLPr8kSyQqBLjOlol/v2ITpm/FiQslbVa5ryazY 7Nv0OMsCXbUXdbYK1bI/9mWsWXv80AOV7Z6H75qx8IQHEVmOOLDhOFbnLQ9URqRMhtt2 iwPfV4xrhQ93T/USrgrHDZ2iLDSv5MPl1UTaEO51NCra7M08+AIAuusfLbKNCUYPkKh5 HGug== 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=8ZCbiEfjrJjD72zxkpoWbYt9TGVqzUwSSEluopUvfc4=; fh=oXT5ltM4iN7aR5ErN+9jmY7U27gS7jdJ6QQoi/J87hs=; b=tZAhVtwCG4WudXeU+XTQjTEAI3ljevjlyDQ2ZhUbPmuGRWdqzVEM1uvcofercFGxz8 wXCdaCkTYYPMqUB8nsqht0Frt59uRjoJW4rERb7Vt9AzQtZzc0Gbh4+qdocvCHpUJCiz 1E4m2uaQyvn0w+nwIoBXP2k7LpFeTsXQKqMMlFbwnkX/pu84D2MOAQmY/r1JZdoq/oLy eCLjASgp6ZMJPPQf2Bk/bOWKdgWegbGmHNBLlusbe0N+LbysTkuv7T5WZ0RhkogVULln CnB+9ww4kKQ9xqJ5CSWAuyCtnUc7taX8s+sriV9auuPb/z/KpU0l+qIpd1UnpRM3MfsR D0uQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=wITfm5rY; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-57022-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57022-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com X-Forwarded-Encrypted: i=2; AJvYcCUySb5cDDlvDysoCXCK1Xat80pOuXW3s8We2nxUT2OTDg16SXYY8Syhmb1OaTJWKQIljdLsJCEMBYAYxxfp7l4gVj95Dw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p2-20020ad451c2000000b0068cbc8dec0csi2250214qvq.164.2024.02.07.16.05.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 16:05:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57022-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=wITfm5rY; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-57022-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57022-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AC2A81C26DC0 for ; Wed, 7 Feb 2024 20:26:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DBCA12EBFB; Wed, 7 Feb 2024 20:24:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="wITfm5rY" Received: from relay.smtp-ext.broadcom.com (unknown [192.19.166.231]) (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 213101292F3 for ; Wed, 7 Feb 2024 20:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.166.231 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707337457; cv=none; b=OrmvIPqxYC39NQKFF7B+RhkWYZ6OpKubrj67QgmVXhOTCx20g//ZP5xM4c8yTS5kVmMGiWWrFKfp2kfJRd3B+HoaVTHF0BL4vFkSc3XpVaowedGe7DWvGlpPT5RbQaUpmuAtti3aKEqFC4WhAKis99lS+Usxu+F9t73xQKEdaz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707337457; c=relaxed/simple; bh=LJwvyvOKR5RJUCQ82QvQcFaSQlghSut08Ka3BcQ0Pc8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Alxc+ZZNg23IpTmjI60b6OiI2I+Q7d8ueMbNSNcKZtLFn9lf3Dk16vx2hkokfTcXNxerI08T23Q6iYVDGn+EqwF23it0yTqpFftKQqCkZuiTQAgnhy/N+qywUa25A5FvI10dalkvT1hqWbtNGfbFi0kGgYJejBc2AofliqilkyI= 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=wITfm5rY; arc=none smtp.client-ip=192.19.166.231 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 6501EC002E08; Wed, 7 Feb 2024 12:24:15 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 6501EC002E08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1707337455; bh=LJwvyvOKR5RJUCQ82QvQcFaSQlghSut08Ka3BcQ0Pc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wITfm5rYzDUAMutE/vaLo4aGl2F+KOQ93Xuw1i6tNJ/JyeBft+7D9NzmayFClBqiT do8ErGbitG+vXXW8pCli70B7FjPPLXexdf7kZwxTYPJnY8a/sdELyGjdCkglsQouFj Ed7yEp+Wnam2x8OxTQx7e82CXIrxoxGFTxNPx/BY= 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 F3F5018041CAC4; Wed, 7 Feb 2024 12:24:13 -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 v5 11/12] mtd: rawnand: brcmnand: exec_op helper functions return type fixes Date: Wed, 7 Feb 2024 12:22:56 -0800 Message-Id: <20240207202257.271784-12-william.zhang@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240207202257.271784-1-william.zhang@broadcom.com> References: <20240207202257.271784-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790286975885318165 X-GMAIL-MSGID: 1790286975885318165 From: David Regan fix return type for exec_op reset and status detect 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 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 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 8c1489ff7bd6..7ce2b267676f 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) { @@ -1749,7 +1749,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); @@ -1760,7 +1760,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; @@ -2492,11 +2492,14 @@ 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; - } - else if (brcmnand_op_is_reset(op)) { + } else if (brcmnand_op_is_reset(op)) { ret = brcmnand_reset(host); if (ret < 0) return ret;