From patchwork Thu Mar 9 06:35:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9612293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3AEE1604D9 for ; Thu, 9 Mar 2017 06:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BCD42840B for ; Thu, 9 Mar 2017 06:35:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C49F285F2; Thu, 9 Mar 2017 06:35:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9AF392840B for ; Thu, 9 Mar 2017 06:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E/IUBphlBJqIckxgm7+WloMXBlsAEsnbT7WWCrGZZ9E=; b=LpK9ee20qxDJhf 0BIiI/vqQQ/bjo4bobncaS23F8uXLg4nvIhVfdCvddUiQFfSpz0l6TvJZ1gfBOo0AGpXGfks2vZH/ U+jpSvhMEJYPHOADPNc4D6B9PnUlBwvwVY4bqgu59TLVWTIDcVZY5rk8ao1oTB/uiLs6dbi7bIMmI pdv1kMZvwC+SdirF5dozS8Rq0OU/fcGEPDAFQqD+Dij8CPLoYJUKNphey+TPiUKJ/vbKwnxVYm4OW 1BBa+cRVx3Y0XmctFlcPw8zYu4MLMKZlKZFlTuFFjOWs3j4ae7ViK1tu3kyipwmm5UTpa1UAtDs7u D1t2GA3Fn64QDDOvr4sw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1clrfu-0006rR-DV; Thu, 09 Mar 2017 06:35:46 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clrfr-0006nB-4e for linux-amlogic@lists.infradead.org; Thu, 09 Mar 2017 06:35:44 +0000 Received: by mail-wm0-x242.google.com with SMTP id v190so9296479wme.3 for ; Wed, 08 Mar 2017 22:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=Zc9xSP5CRInzkdg9e81mkY8pCj176UpCkKDdMqZOHrQ=; b=mNkK7kWKOvGLX5ELFsws4hMVpHaSAE/gMFHQuYhimBePyJOPATxa0crSYBz4EZhqjJ 2YSyThRsoUrOtWtVX8a9lq5BGEtGRVslbpxgw3o8tErZ0JYHeXKUhIOFmsjSjI1DXoHR sjD3QwSGWBD9BEmoaU2llBbQZc1MiLPG2V4a89BLFPejRKv4jaV1N0ZwVXu+5Tq5yYre yvFKhuPr3OHjQbpIa1r9utO2nJ295vzvhGVOE7POg8TLHRL7qUBi54NJ9KtZ1UdePJgQ 4HDpQpHK5aLWi47qb+hXKfWi086APMfKBvuCdnXk0w1EOsfTF4+qZJQsnaT/fQluMfw8 hopg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Zc9xSP5CRInzkdg9e81mkY8pCj176UpCkKDdMqZOHrQ=; b=MZGiIZXkyulx4xM1obUXDAdps87fh3M8B3idWwqxCTHGyzUMyO1EyVGwrLTDYUshxt +hsHfbbV1kBniLSd+AVfND5Qf8LZRxhwLyCGU6/lkLDIrAYG1ihFCGam7dhajc20wlM4 LrU6VWeGbWFCF0aiCV0mtgDWSQgSL6tOD6wudPLQctpl5H5JcUeqlHut7LT5X7xEerHH 11Z+RjPsorOr5M/81f8tnX/et9Pt4o3HLiGBwbeHb40FqRRDyBwpHdMBNMkdONMMjnPo GW6iftH9Bdamdu0fzyw5ZugMjYdbTo6xa7nEYg/2E9AVuoZ6H34cj5AifRwFqcEIIMdF DF2w== X-Gm-Message-State: AMke39l1N7oCnmtQsHMWgWYp90B/be6rpIgq79pJaFXDbhpgLQFgXzohMY7yOnOpMj4onA== X-Received: by 10.28.169.87 with SMTP id s84mr25351569wme.77.1489041319230; Wed, 08 Mar 2017 22:35:19 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:b589:624b:5134:aa75? (p200300C6EBDC4000B589624B5134AA75.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:b589:624b:5134:aa75]) by smtp.googlemail.com with ESMTPSA id 10sm6966311wrw.13.2017.03.08.22.35.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 22:35:18 -0800 (PST) Subject: [PATCH v2 01/10] i2c: meson: i2c: meson: use min instead of min_t where min_t isn't needed To: Wolfram Sang , Jerome Brunet References: From: Heiner Kallweit Message-ID: <576f851e-9dda-8feb-1192-e5cddf4ab549@gmail.com> Date: Thu, 9 Mar 2017 07:35:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170308_223543_344033_EA84FF94 X-CRM114-Status: UNSURE ( 7.89 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, "linux-i2c@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use min instead of min_t where min_t isn't needed. Signed-off-by: Heiner Kallweit --- v2: - no changes --- drivers/i2c/busses/i2c-meson.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c index 73b97c71..40e5da9a 100644 --- a/drivers/i2c/busses/i2c-meson.c +++ b/drivers/i2c/busses/i2c-meson.c @@ -156,10 +156,10 @@ static void meson_i2c_get_data(struct meson_i2c *i2c, char *buf, int len) dev_dbg(i2c->dev, "%s: data %08x %08x len %d\n", __func__, rdata0, rdata1, len); - for (i = 0; i < min_t(int, 4, len); i++) + for (i = 0; i < min(4, len); i++) *buf++ = (rdata0 >> i * 8) & 0xff; - for (i = 4; i < min_t(int, 8, len); i++) + for (i = 4; i < min(8, len); i++) *buf++ = (rdata1 >> (i - 4) * 8) & 0xff; } @@ -168,10 +168,10 @@ static void meson_i2c_put_data(struct meson_i2c *i2c, char *buf, int len) u32 wdata0 = 0, wdata1 = 0; int i; - for (i = 0; i < min_t(int, 4, len); i++) + for (i = 0; i < min(4, len); i++) wdata0 |= *buf++ << (i * 8); - for (i = 4; i < min_t(int, 8, len); i++) + for (i = 4; i < min(8, len); i++) wdata1 |= *buf++ << ((i - 4) * 8); writel(wdata0, i2c->regs + REG_TOK_WDATA0); @@ -186,7 +186,7 @@ static void meson_i2c_prepare_xfer(struct meson_i2c *i2c) bool write = !(i2c->msg->flags & I2C_M_RD); int i; - i2c->count = min_t(int, i2c->msg->len - i2c->pos, 8); + i2c->count = min(i2c->msg->len - i2c->pos, 8); for (i = 0; i < i2c->count - 1; i++) meson_i2c_add_token(i2c, TOKEN_DATA);