Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1525738pxv; Fri, 23 Jul 2021 10:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB9Yxo50qzNX1mKfcVavkGzpw9LTfibZXDdVyzXfmpk5AGJsqDvc2JF16LzMdj7M5bTCIJ X-Received: by 2002:a05:6638:3887:: with SMTP id b7mr5191534jav.42.1627061045551; Fri, 23 Jul 2021 10:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627061045; cv=none; d=google.com; s=arc-20160816; b=V00z2ApMwfgIhWxwm4FfnenLjB9DA2Y5gPqF7NDf0HLW3uuclnikjp+OpQy10nC74l eyQ9lA0/QAMMo5HXWeBFIVzSt5ZTjafWyKF2yE1JEZxIiU0NLUbbF+dWPFvO/pHkD4sg BW6JG4lmbwF3Azpfdtqu2co8UTJfko92K4k48NlZGvP3QgOGZz89mhNFafMJ2Z0E4qsb l0ViHKNfW0AspIwYmsjG/P+lBr6aKUOA4WUXFwRmQI0X1h/LIDHy8A5PntIYAUtUCjff svjOWeBPhouz+IE7duwJlDfMnSlEWUDwqCAL/PaE1+MS+JTI4Gh8rxD68QED+nrRdRVM eADg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MEQCVop6cPBpgy2Y5Ip01XHU/jGOau6kU5gyPBsKTIc=; b=gh0Ile3b+UbcR7O2twmV0wmmLSAGfgAUz8jHJnIIJOawXvcO8dx8GZJYAhb6D9Xopx yMpcwYvzGsm83jPSEy291sX7ILXYzAHTutm+l8H9G+godrOlt37bVj0yIrACDKfE3hyY lDHinrtPr3ow9Uk7fb2fU+Cj6A9msb2wk2RHCFeGUvJWVvlAvhsaHTyqduZbycmPMXZP EdLA8JiS/E2g18s7FnjOJ0+s1UgiA9Bx7Tidwt8pV3q5bb2exQIuqmaHP8egSblHkrkc Ds6Mtdxi5ZPH5AyrU2gC68KMej5/o5tZBma6UMi5X4zBlk0ZS71ko+QKLAzWyXpHFqrM cb1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iC8yPQ3h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 j3si29889654ilu.69.2021.07.23.10.23.46; Fri, 23 Jul 2021 10:24:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=iC8yPQ3h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S231481AbhGWQmI (ORCPT + 99 others); Fri, 23 Jul 2021 12:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231317AbhGWQmI (ORCPT ); Fri, 23 Jul 2021 12:42:08 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4EEC061575; Fri, 23 Jul 2021 10:22:40 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id gt31so4586576ejc.12; Fri, 23 Jul 2021 10:22:40 -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:references:mime-version :content-disposition:in-reply-to; bh=MEQCVop6cPBpgy2Y5Ip01XHU/jGOau6kU5gyPBsKTIc=; b=iC8yPQ3hj9pherQ3A204v9L8QDQ+/OEoo9xlq0hZvJb2Lra35Fs/HQQHKo6aTBydx8 Seppj14NB9J9COH3Op5ppPzuveKkebPf0zc2/7pNf1H7/uaco3/1hOoq9tANzz2bumBR Q/kweD+XKiswm4j7oJh82n5V0S+342h7tYF1cynMUhZ11HIt7lHe741Nfu/g3j6lsz6y SPFMyrNnQDt7ySb8p8EHV/yYe8n9vgObaHxdz6bsEz7RBoa25v1njVXrXE6kOA0BOBMj enLCQIos5AvSbWw7bMQz9PDUMmtzHqvlBW6/pNfV6B0W91+Z2gnC+Rd4zF+uvNHVIgVj vR6A== 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:references :mime-version:content-disposition:in-reply-to; bh=MEQCVop6cPBpgy2Y5Ip01XHU/jGOau6kU5gyPBsKTIc=; b=HCbIZ8w/1QukYPlsDFA+6krTSnbqOX7Vs+sxTa7BYZd0TsprEX4/Jti6LSoyuWOpfv XPdR5Ygubze2ncg3dblh4ZnrFZYB1i25hsM1eyam7qpJOQ0RPz6sUfdnRiHKHhO4s5O6 T4xa6/j2V035z0v3fTV4GNRg3NPfgnkwsaTPVVwb4Fjv0lqXIs/rdQtifIo5wbm8BDqg A5UJA+8Q1wqPKLl/lURU7df9++Jf5tXp7aLTKq4yAHO2xsOJyrxO1Z2Q/XZwFvobLyt4 9fUdIdKTQwDFbkAJHYGLIetHaEGymZIYZuCWcyt429sGCWomYy4sYDptMxA5aC1EGECF 1qHw== X-Gm-Message-State: AOAM532rCu4Y0RWzA9njBaBZz2gfBPvgkXJxXDAKyTr/EFaiEtHjnbE1 V8ozb8wU2y+VqiK5XCvPoIE= X-Received: by 2002:a17:906:3b0b:: with SMTP id g11mr5764276ejf.286.1627060958793; Fri, 23 Jul 2021 10:22:38 -0700 (PDT) Received: from pc ([196.235.233.206]) by smtp.gmail.com with ESMTPSA id k3sm14342229edv.2.2021.07.23.10.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 10:22:38 -0700 (PDT) Date: Fri, 23 Jul 2021 18:22:35 +0100 From: Salah Triki To: Steffen Maier Cc: aacraid@microsemi.com, "James E.J. Bottomley" , "Martin K. Petersen" , gregkh@linuxfoundation.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND] scsi: aacraid: aachba: replace if with max() Message-ID: <20210723172235.GA78880@pc> References: <20210722173212.GA5685@pc> <09202d04-d066-a552-7a33-6c4c3b669107@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09202d04-d066-a552-7a33-6c4c3b669107@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 23, 2021 at 06:56:51PM +0200, Steffen Maier wrote: > On 7/22/21 7:32 PM, Salah Triki wrote: > > Replace if with max() in order to make code more clean. > > > > Signed-off-by: Salah Triki > > --- > > drivers/scsi/aacraid/aachba.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c > > index 46b8dffce2dd..330224f08fd3 100644 > > --- a/drivers/scsi/aacraid/aachba.c > > +++ b/drivers/scsi/aacraid/aachba.c > > @@ -485,8 +485,8 @@ int aac_get_containers(struct aac_dev *dev) > > if (status != -ERESTARTSYS) > > aac_fib_free(fibptr); > > > > - if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS) > > - maximum_num_containers = MAXIMUM_NUM_CONTAINERS; > > + maximum_num_containers = max(maximum_num_containers, MAXIMUM_NUM_CONTAINERS); > > + > > Haven't really looked closely, but isn't the old code more like a min() > rather than a max()? maximum_num_containers being at least > MAXIMUM_NUM_CONTAINERS or higher? > In the old code, maximum_num_containers gets the value MAXIMUM_NUM_CONTAINERS if it is less than this value. Thanx