Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2927778imm; Fri, 19 Oct 2018 02:01:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV62GcTO8jGN8BU222fNh/WSGNlIWp7jM1PXGRreHgkJePkXzZVaYSMgnhUn9nmaYOXb9EEj/ X-Received: by 2002:a63:2dc3:: with SMTP id t186-v6mr6190443pgt.10.1539939687166; Fri, 19 Oct 2018 02:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539939687; cv=none; d=google.com; s=arc-20160816; b=wbyh996e8zwBbGRutbV7hSF+15W2m2NZMnJhYE3CZMgQrLy6duB8N8AmKHf8JMeOqW 4CvHb0K4xwzatt9RBraQpm1is9m2tQMw5/7r5zILmrbY2oKo4i2bP7UgLQ87xS9IinZ2 7VsRMJ4UZL+e9teJptgcCh5KV75OnhnjrRf8jkGIN05pbcB6c+YErfLqgw9WScYvLj+X el5PDQ24W9iYBi1yE9FcZr8UlW319qaBHtYZb136FJkcG8WDQ/ayExw6j+2Q1oFsFjb9 aBZViBPm4zjAueVrTd5Xo1RIhO8Sb7yHmSgxCx4QZe2tNMnAveZ8tgdMLeab+S1WPWbt PP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=EVwRx7vUtjK0+Qej6+Gz60cyA3uNr64RNMKnWNdPq9o=; b=Y5NzA3NizDMH1NM0/zrP/NTjplzNy+f3VkiPjvZkZxs4ZVFtEAlekDrkii0lFaauwn 9OIPa6hm+w9I4F63LhCe4KSfA8mmOrNHP+iS/dPz6A6OZIwSonaRrPXkF9uCj3Wy0q3q vMB8IuRZwjtJkVE9C53m5YyPK6wA/aMaUf/yUGsWh7Af9Mzs/T81v09o6jNahszwRU3K RKZwVhPXh7fPBfeX2iu9RNxaXJZm8CXGIAe9orLcuQTs8Rz+Gk/g5ayAcRUPmK8dr9PS 5WdvnP/WY8CliXGlEBLp2oxHom5/W0zg1iWs4WAXlutCDyhjXGGn5J4ugsF7At/GReVf qomA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si24589088plx.28.2018.10.19.02.01.12; Fri, 19 Oct 2018 02:01:27 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727245AbeJSRFM (ORCPT + 99 others); Fri, 19 Oct 2018 13:05:12 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:56064 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbeJSRFM (ORCPT ); Fri, 19 Oct 2018 13:05:12 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.23/8.16.0.23) with SMTP id w9J8xImr014608; Fri, 19 Oct 2018 03:59:59 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail3.cirrus.com ([87.246.76.56]) by mx0b-001ae601.pphosted.com with ESMTP id 2n3es40ju8-1; Fri, 19 Oct 2018 03:59:59 -0500 Received: from EX17.ad.cirrus.com (ex17.ad.cirrus.com [172.20.9.81]) by mail3.cirrus.com (Postfix) with ESMTP id 08869611C8B1; Fri, 19 Oct 2018 04:02:18 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Fri, 19 Oct 2018 09:59:58 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id w9J8xwPm031397; Fri, 19 Oct 2018 09:59:58 +0100 From: Charles Keepax To: CC: , , Subject: [PATCH 1/2] i2c: Remove unnecessary call to irq_find_mapping Date: Fri, 19 Oct 2018 09:59:57 +0100 Message-ID: <20181019085958.32694-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=970 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810190082 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org irq_create_mapping calls irq_find_mapping internally and will use the found mapping if one exists, so there is no need to manually call this from i2c_smbus_host_notify_to_irq. Signed-off-by: Charles Keepax --- drivers/i2c/i2c-core-base.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index dc78aa7369def..656f0a6fe3adf 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -306,10 +306,7 @@ static int i2c_smbus_host_notify_to_irq(const struct i2c_client *client) if (client->flags & I2C_CLIENT_TEN) return -EINVAL; - irq = irq_find_mapping(adap->host_notify_domain, client->addr); - if (!irq) - irq = irq_create_mapping(adap->host_notify_domain, - client->addr); + irq = irq_create_mapping(adap->host_notify_domain, client->addr); return irq > 0 ? irq : -ENXIO; } -- 2.11.0