Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3284754pxv; Mon, 12 Jul 2021 13:46:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNaeBocF0G+bL45ym+SIjmdq8A09LNhHEmOIvbJxiFUFNCDIIzOJWy0wpLRtp1FNkus4Tr X-Received: by 2002:a6b:f914:: with SMTP id j20mr542545iog.127.1626122779611; Mon, 12 Jul 2021 13:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626122779; cv=none; d=google.com; s=arc-20160816; b=jYwLPVpNugoZmng65rOc04Joy4wkZFfMHvsZqJyto0eU2BaZZG7zjfgCN36KsAk/ot bJ6PTvaUFZ9/QDjPzge9bO/Aj9fTnVJ9cZHiC9ApoAhLZs9whHhxG5HDqtJHxfEXLkE1 5ruw2CU+BUJ++4CoRAonwJVK/qoqE13QzW+TxtTzq+q2vwSzgWISFpxqDVsmguO6eXqE N7DdpNQnmHOe9w2yW+EBKeb80b44fyk5zkdc6E5i/OwBDrLK7xZ0xvFnChLZDhnG1LnN 1+Kb5A042FM7FYX8InIRKDormBwMsq70v925HlBVqRhltslvPbiktkznlkFjb8FrC4Zu Q44Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=dDg6dKdVLJtJjWTE5YR4R8BahCCcS2EwH/pICn0zM0g=; b=EBgP7ECAj4HX38mNaNp4GwGyBY6nhhkCd20xm3Hf1L8++itr7nia+QQC/7sn1NYN2z OvDv7KFC6RyfDkrrGMD3OcrXfqNcsI5qGjEJ0saAmw5t/+EFiSIfugWUQWe/P85iwpM+ mkUS7EJqCXe5mb1yNyhWO603KykFieZGoukhFq30rm4pnmkXOiEugqO+X1YrzkJUOLCw SThRUtF4lWpw46gWPzBz+8yNQONtRKxAAEzLGHaLxh8ktjiQVGH+cQPU55pkQCvAWp9L +NbZW6iGST70SCq3u1VwEDq37PbnLORu+zUAC7IvW+pVg5He2pM1ccUOHKr8/+oJVQF3 rAvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VvA9gF1c; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si3253571ilv.11.2021.07.12.13.45.54; Mon, 12 Jul 2021 13:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VvA9gF1c; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231795AbhGLUsk (ORCPT + 99 others); Mon, 12 Jul 2021 16:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbhGLUsk (ORCPT ); Mon, 12 Jul 2021 16:48:40 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E30DC0613DD; Mon, 12 Jul 2021 13:45:51 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id s15so29915945edt.13; Mon, 12 Jul 2021 13:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=dDg6dKdVLJtJjWTE5YR4R8BahCCcS2EwH/pICn0zM0g=; b=VvA9gF1cQzfsFJJuZw2k6deH0TrKgAqzG7Lh3UsbcHfVdGVULX6QCCBcDJkyEzUz6S 4M0lhD/f0O3zOV/qW/FH+AdiIPmjmsUduCXl6hYUHdp0jGxO78/bsxoJe7yL4u47uXAT tIbgGLcdyJo2USYyUEiAAC42fyPLUXRMCVa3JkgqjQ4V0cgkjc3wrkDUPdEYzp64M1/4 kW+QcOi3Npa4jrni6tUvOEtIWOGIx/uQf0sSsamDOx8HwRbNEELxMo2PCR1eJWjfQjNo XuctAP+IH3aZE96KMW8ZiFzNDr+Jwl7oANfweKQq9/jpchIKc9rys4gkFmtEyMKvWiCa /JgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=dDg6dKdVLJtJjWTE5YR4R8BahCCcS2EwH/pICn0zM0g=; b=uFRD2yGrsEjFTeQcKxAHvGrQId5fahUUNMCTUEIS54Y9YO9NtJ17PuLB7GqSxBOYhl S9eSbrf16awof7Vq3R75Bx3OYEF1YF3rL/4KMHa9BqlYbRalgtHajgEikwLTnyUvV7qc grLoB27GuPQVSXCmupMypWXEh3gxzNuJjJsJs9sPxjkTM0qDmpVAw35NDbj7QMxptw0l 53g5z6DOf1/OSeMB2W6lx2F8OvuDVY+q7dQHVGgmAN+IRj0p0PYL9HsA9pnVNeXaJtYa yfoG0Yd7Ml1FkThjGvYFq0WVkh9bN3F76DAmADrJtdjrwSoEMyvkaPgihx43SUTjepd3 8TpA== X-Gm-Message-State: AOAM531aXxX44/AaSt1SXpNE/RzAbLYsTacBv1aeNiD7/7Fo+LtCnWxE XvKxD6bqtu0eJ/3Ba7PDdZ8= X-Received: by 2002:aa7:d5c8:: with SMTP id d8mr882407eds.165.1626122750086; Mon, 12 Jul 2021 13:45:50 -0700 (PDT) Received: from pc ([196.235.212.194]) by smtp.gmail.com with ESMTPSA id p26sm6814303ejd.80.2021.07.12.13.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 13:45:49 -0700 (PDT) Date: Mon, 12 Jul 2021 21:45:46 +0100 From: Salah Triki To: haren@us.ibm.com, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, herbert@gondor.apana.org.au, davem@davemloft.net Cc: linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] replace if with min Message-ID: <20210712204546.GA1492390@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Replace if with min in order to make code more clean. Signed-off-by: Salah Triki --- drivers/crypto/nx/nx-842.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c index 2ab90ec10e61..0d1d5a463899 100644 --- a/drivers/crypto/nx/nx-842.c +++ b/drivers/crypto/nx/nx-842.c @@ -134,8 +134,7 @@ EXPORT_SYMBOL_GPL(nx842_crypto_exit); static void check_constraints(struct nx842_constraints *c) { /* limit maximum, to always have enough bounce buffer to decompress */ - if (c->maximum > BOUNCE_BUFFER_SIZE) - c->maximum = BOUNCE_BUFFER_SIZE; + c->maximum = min(c->maximum, BOUNCE_BUFFER_SIZE); } static int nx842_crypto_add_header(struct nx842_crypto_header *hdr, u8 *buf) -- 2.25.1