From patchwork Sun May 28 19:58:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 686830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B62A4C77B7E for ; Sun, 28 May 2023 19:59:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbjE1T7C (ORCPT ); Sun, 28 May 2023 15:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjE1T7B (ORCPT ); Sun, 28 May 2023 15:59:01 -0400 Received: from www381.your-server.de (www381.your-server.de [78.46.137.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F5C3AC for ; Sun, 28 May 2023 12:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=NWmRmxfw/wubpKhJ52zXFZDg20szMw4ma7f74ukQbq8=; b=iAPKrjM+NqmdtYPrSkdD3PSp8D 7mJzGyXnvwG09TBEYU/+bAI+b5W0HVu0a264ilF7IIJZQizsmJ705glLLg+o7mg6MPeoEGMHqQrbD eXgqtqiwPGA0iMTagIBlsqK/2xhQZb3Zr7836i0wFrZocNh7SRJlztGBIYkZEWTC7qH3PA/8zEkE2 NwLwsGpuWCyAdzqBW2jPF66JZE40lVQVG/1QqD84kyPfssFd87+4xVT9egZBat4FkI/4MBBnjUQT4 oOgWHEI+YcZldkEchW/EtNpo6y3fGlDN44RospGlEAKXomd/Ih9DgmTk3113Ri1YYdEjd9lWRQnjn ClCMGVFw==; Received: from sslproxy04.your-server.de ([78.46.152.42]) by www381.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q3MXb-0005Nn-97; Sun, 28 May 2023 21:58:58 +0200 Received: from [136.25.87.181] (helo=lars-desktop.lan) by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q3MXa-000DRD-GO; Sun, 28 May 2023 21:58:58 +0200 From: Lars-Peter Clausen To: Mark Brown Cc: Kunihiko Hayashi , linux-spi@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH 2/3] spi: spi-sn-f-ospi: Use min_t instead of opencoding it Date: Sun, 28 May 2023 12:58:29 -0700 Message-Id: <20230528195830.164669-2-lars@metafoo.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230528195830.164669-1-lars@metafoo.de> References: <20230528195830.164669-1-lars@metafoo.de> MIME-Version: 1.0 X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.8/26921/Sun May 28 09:22:09 2023) Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use `min_t` instead of `min` with casting the individual arguments. Signed-off-by: Lars-Peter Clausen --- drivers/spi/spi-sn-f-ospi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c index 39c4df54cdb8..691b6092fb3f 100644 --- a/drivers/spi/spi-sn-f-ospi.c +++ b/drivers/spi/spi-sn-f-ospi.c @@ -566,7 +566,7 @@ static bool f_ospi_supports_op(struct spi_mem *mem, static int f_ospi_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op) { - op->data.nbytes = min((int)op->data.nbytes, (int)(OSPI_DAT_SIZE_MAX)); + op->data.nbytes = min_t(int, op->data.nbytes, OSPI_DAT_SIZE_MAX); return 0; }