Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3188289imd; Mon, 29 Oct 2018 03:14:13 -0700 (PDT) X-Google-Smtp-Source: AJdET5cCe3aI224tOOP2IbO4qpShqJHpqpqOz+Z0l9QvMoUMHMMH90VVcAJj+CPoHrOAUAlzeApZ X-Received: by 2002:a62:4896:: with SMTP id q22-v6mr14599069pfi.248.1540808053392; Mon, 29 Oct 2018 03:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540808053; cv=none; d=google.com; s=arc-20160816; b=AgkTVnpdZmYFSHcxgDznAPHIsmd6Vc9kzeg7BWJgcl+zHuIXu5n4Mp3FLy9oESdj2g 6gBfN7nQVMA3U7CBE3rxtJqwAxYAt34ZKHnHWhAncNvq0DTM1rvXvley5hi+rLZ/JREp jm2l2X8tUwqSP2NwIKVII10duUhRmV7FFv5A94DsXIC08hJyLcZ0z2ZD8HGM8wQ+vaqX ukQr4jhJfIYiZT15BKfBybdVfAN7t2dzdm+sQ5JIyqMJ/X6XkKfVqSntpgdw4SHLju5v 4GfX179vbEKd90Z3WHSOmKj2x1eoauwpo1T4ZBjo+M6mUTBBE+oPSCJtFyni2Ksb5ldO coKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=R9bp8gkMS9C+dO42+zhGleEzu1QlarVWXb90brUPyjo=; b=sO8xg3+4ZFWH0iP9wjDVJrrgROrnfBFynHqD20PN/tz+a/vzOSvO7VtE+Xi7+g2cWi mId0+IF0EIl2hy89VdBv9AIxwjILRvYbAMHjuIm43/Kaxhb1BWe1TYr6Mwh/lOPiGxkA tctl06+FCaDV1014npzUWczGxVKUz6Q93oAOhBgFMn/f0GqGPaBpNW3hZBEFgCRSCL3d 1o0aUU9rk4TdwtB/Q/MSLMwPJzs62tcMggTpuGTYmZ3byVDNq4CmIFwIoE5xVvGmkwoR fFkJ9PhxOuRELDBsIvF5Nf5TNaxmWY42iCzybxXItkL4asMGmrBsFE+gHd0NaoMwJ7Ub gaig== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4-v6si7052809plb.62.2018.10.29.03.13.57; Mon, 29 Oct 2018 03:14:13 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729760AbeJ2TB1 (ORCPT + 99 others); Mon, 29 Oct 2018 15:01:27 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:44181 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729631AbeJ2TB1 (ORCPT ); Mon, 29 Oct 2018 15:01:27 -0400 Received: by mail-qk1-f196.google.com with SMTP id n12so4497638qkh.11 for ; Mon, 29 Oct 2018 03:13:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R9bp8gkMS9C+dO42+zhGleEzu1QlarVWXb90brUPyjo=; b=ufF6lkKaRxEUGJA5eiE4zJ6uKz82oYWRIU0Pov469HMhYti8f7yF+MBO1ZydBDHCrt OwsnG0k+RSqFgjypmCpsOzjdlgBBWlg+vATOGpgnzmW0SpSqG2L7tIPfEn2Gx21YZ/tY 3pkTQWwlAWo5IJaeiPglPnUmaY7ca7sHc2dTWcn9rOMMYcOlaDbnFulw97cUXbT59DRl u+M0jb7NsKxNniD/dh4fcXKYKE1zl/aArIl4+f9crVQB4NyPkQ9r0o2Q8b70Ki6mq4xr FQzg2qJoxjuczhkoSZnhY2ftXSAeKpFuu6TLSX2oZR2milIUlbn+DCQtW07ysZiIhO2j tC2Q== X-Gm-Message-State: AGRZ1gKZfPrkrXAAst6nGVt9e/3IieXpFyNUUCSZNYR2PmFW540qPkQp tOccl89Rqu7TTYzzLJ2eQi5lTHPDgtqGscgBXDxUOg== X-Received: by 2002:a37:4792:: with SMTP id u140mr5757010qka.301.1540808006277; Mon, 29 Oct 2018 03:13:26 -0700 (PDT) MIME-Version: 1.0 References: <20181019085958.32694-1-ckeepax@opensource.cirrus.com> <20181028223041.GI1882@kunai> In-Reply-To: <20181028223041.GI1882@kunai> From: Benjamin Tissoires Date: Mon, 29 Oct 2018 11:13:14 +0100 Message-ID: Subject: Re: [PATCH 1/2] i2c: Remove unnecessary call to irq_find_mapping To: Wolfram Sang Cc: ckeepax@opensource.cirrus.com, Linux I2C , lkml , patches@opensource.cirrus.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 28, 2018 at 11:30 PM Wolfram Sang wrote: > > On Fri, Oct 19, 2018 at 09:59:57AM +0100, Charles Keepax wrote: > > 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 > > Adding Benjamin to recipients. He wrote that code. Yep, definitely looking good. For completeness, I just tested it on the t450s, and it works fine. This one is Reviewed-by: Benjamin Tissoires Cheers, Benjamin > > > --- > > 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 > >