Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3971316ybl; Mon, 9 Dec 2019 03:16:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzgk3WyXAG+ggGrgzNAUodH97iTLnH5lCx9BT0A3SeoZUeDvZgyKbhjAuM4crqhFMYjZOB/ X-Received: by 2002:aca:7583:: with SMTP id q125mr24668587oic.100.1575890178157; Mon, 09 Dec 2019 03:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575890178; cv=none; d=google.com; s=arc-20160816; b=PzERhY7ew1s8UxEEsUGaUaI9Si1Qv7Ex62RCLX2cAskuQaV/Gi91TqQ+qKJh/Yi+2a xoEno4V71/F5jUSf3bvzjKR4YsBGehOOtJH7zn8VVOwdQza+Na5UicEjKpFLLTCv8Pdm fW1aliReA06a1YtpGBgr9dVVghpGZ0eJVtUhwhQ+Svj3v6eJhkdsU5/s5Fs/EUFYqE71 q1KDA4NguF9ZLTIhXgGS3aHSjDXwCg94VjIhoIg6MaPsRQ29fJMjqBUIfu+B+MclfJHF TEPqVsVQFCMlHS9/oi5UJP2zY3is2A4HOGvqXLP4kqPlhhuzSSqAmRDZzaDLlf1TJXiZ Sztg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=0v6TcqX+2q4zO9kQfJmYbgUU2bsSyCYLIYQGiirJCJk=; b=tiZPGP9yZZLxsSnm5hxKiKkfHqOdCB8UVEconSL9zjNr7B+dfNQYX3XBONeYeE2pg8 x+ugpAngydolmNfZzEo9fvOhykY/74MCRLesFvNWZbmUuia3YwMw4AzrzzuzCmxchVQT OgxbLTajWkmk5UGQqWleWESXhLjAoX7nQXGmBCw8CXtYRtngC53R7EZLpCY0/XdErX0c 9k4y5tpZHkd/mvPfPE7jhL/US2cWlHzafQmatKLnuOOUeIg60voQMOeLOC5tQB71gJvP WP0R6KDw1ZmzENOKmQdDdh9zv4jtuOfbMr9Rr9WsU8zcbgw/jLyv3KsoydnNWPrzVI2a 6/cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=i6gezNq9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si7061171otb.26.2019.12.09.03.16.05; Mon, 09 Dec 2019 03:16:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=i6gezNq9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727810AbfLILJ6 (ORCPT + 99 others); Mon, 9 Dec 2019 06:09:58 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:7924 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727678AbfLILJW (ORCPT ); Mon, 9 Dec 2019 06:09:22 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB9B3UZm022346; Mon, 9 Dec 2019 05:09:20 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=PODMain02222019; bh=0v6TcqX+2q4zO9kQfJmYbgUU2bsSyCYLIYQGiirJCJk=; b=i6gezNq93Tx8U1ELAa70UF76ndB8APrC7LH/VhNCEleKqPiSCkrAlDeA4PdS4As/HbUC OTL432tHOuGJZwJx7gPuY1pb8lT/s/IWlWv/O7k1BiIEqCZZax70NNBsjG8GKmtNi+rA veD5wAIbqYLdtKJirQNwPnS9/S/mTF/H6uwNc0eKBUhq4TfgpJa4tER2y31/vrksiJDa hgVOnbiG0sbGupem1zqB2exV+XkRDsArjXErBE6H3qCpj0auOM1jBJdU2FL5O5NUVPwi RYn3bbRbviuFEyWWm9xiqVfNbExjKF0T69qY36LkBxXElhdXK4S/SfLONFCwwl5SsBzQ Vg== Authentication-Results: ppops.net; spf=fail smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from ediex01.ad.cirrus.com ([5.172.152.52]) by mx0a-001ae601.pphosted.com with ESMTP id 2wrac6j0mu-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 09 Dec 2019 05:09:19 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Mon, 9 Dec 2019 11:09:16 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1591.10 via Frontend Transport; Mon, 9 Dec 2019 11:09:16 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 7B22B2D5; Mon, 9 Dec 2019 11:09:16 +0000 (UTC) From: Charles Keepax To: CC: , , Subject: [PATCH 07/10] extcon: arizona: Remove excessive WARN_ON Date: Mon, 9 Dec 2019 11:09:13 +0000 Message-ID: <20191209110916.29524-7-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191209110916.29524-1-ckeepax@opensource.cirrus.com> References: <20191209110916.29524-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-SPF-Result: fail X-Proofpoint-SPF-Record: v=spf1 include:spf-001ae601.pphosted.com include:spf.protection.outlook.com -all X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxlogscore=652 spamscore=0 mlxscore=0 clxscore=1015 adultscore=0 impostorscore=0 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912090094 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A WARN_ON is very strong for simply finding a button that is out of range, downgrade this to a simple error message in the log. Signed-off-by: Charles Keepax --- drivers/extcon/extcon-arizona.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index e7c198e798e27..3f7ced35e0b86 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -960,14 +960,13 @@ static void arizona_micd_detect(struct work_struct *work) input_report_key(info->input, info->micd_ranges[i].key, 0); - WARN_ON(!lvl); - WARN_ON(ffs(lvl) - 1 >= info->num_micd_ranges); if (lvl && ffs(lvl) - 1 < info->num_micd_ranges) { key = info->micd_ranges[ffs(lvl) - 1].key; input_report_key(info->input, key, 1); input_sync(info->input); + } else { + dev_err(arizona->dev, "Button out of range\n"); } - } else if (info->detecting) { dev_dbg(arizona->dev, "Headphone detected\n"); info->detecting = false; -- 2.11.0