From patchwork Sat Jan 28 10:38:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 4667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1282615wrn; Sat, 28 Jan 2023 02:40:34 -0800 (PST) X-Google-Smtp-Source: AK7set80nmdIq2jM8wAoT/tiGbO6Zo3sd1HG7A4eTLO7L05tp24RcEk8FTL9SeLGNJVOSsY9c3R3 X-Received: by 2002:a05:6a00:278e:b0:592:52a0:6817 with SMTP id bd14-20020a056a00278e00b0059252a06817mr6740066pfb.6.1674902434383; Sat, 28 Jan 2023 02:40:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674902434; cv=none; d=google.com; s=arc-20160816; b=zYkrWTLnA/adwjQrWBXGDJz+SXdwH0QNp8KD0yqOFidzlJt9vYGGN53zgpIZQCjOMc Zs2yFKoN5j8/62tGgHWwZ8nlW8Ue05NBsqAVdJJacSlkM3wT/5Kd/Zyre9421Q1hdrvV gbXdkmR5KtEcFmF47HIhRCygI1jc9N+tQzxL71Unzl+OIM+jmA1Rlw/Qoisoa6oQfALv wQz/TvDLCFqeDXLK2xQ3h1UY42uFRhIEXzWQNNzCJD/3+wZkLXYvW0eY5SHZOzo8czsI 6E/YUn6yNVt3YpjjqjZYAlCCdChQXg1TNSPif5g3EPnayH/4VC0c7oTI1qGMcJkz4Nyo XWbg== 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=Poymp8amp0xINXaQtyExTFZ180tkFNi5ZW8u4enHxME=; b=AB3sPCrt+yCjlh3fH20lcXWOwjeVGlKkRG42N5GMjLE6PRsy9SYGdwfO18jvz4IODn 5rQ0P33QrK91xxbm5qzWkEPc1oenVdZYfBZJEJJxuTtKeiJyHcNhAsjldF8BAlPBPrCR 4g/zDiLi52iddQRZpsOTSzKhUokP2MrP2YGPE3mWUXKFqnTmbSMid1U771SSANH7ukpy f7MBJN5t7JP5ZgFDf7l283yO/QGvAjZdM0ayquvlls7sDwJf5vI47zc89NEHUYP6B1S/ 2A5xEv9ilbdGydxVopkjuMZywk8I4VJRLyW4E1M1+FyLrVB0VsajbNLfpKH3Q6FXg+vC pf7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=YHVjWbSF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bu7-20020a056a00410700b005925f144d66si5589718pfb.222.2023.01.28.02.40.22; Sat, 28 Jan 2023 02:40:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=YHVjWbSF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234124AbjA1Kit (ORCPT + 99 others); Sat, 28 Jan 2023 05:38:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233571AbjA1Kir (ORCPT ); Sat, 28 Jan 2023 05:38:47 -0500 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48DDF7752A; Sat, 28 Jan 2023 02:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1674902315; bh=Qf1j0H73Nv8f2iy3YuNlNYJSuoKVTL34r6A9vrjmjk8=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=YHVjWbSFlyv5MgHKTMxmxcUrL+mSNCu6IqISx32ObU6bAeZ0bL/fBKni6t5R9LW24 Xwav1oBmWonskrp3SJsom4eXreP3kbbt3REBOonPtOxnnYnMSC58Pl5b+Txh6yVIkn XADUf+LX8xx7C+M04q7pyRL8TZ9nMq+F0kFxwOGg= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sat, 28 Jan 2023 11:38:35 +0100 (CET) X-EA-Auth: ZizyT+JKiUVNqc1hAoM1JFLj/hxNuqa2tHITJgmEKqR5OIhY+AUGsbPXjaTRUX5bgePdTS5CQxY0U3ys2ggAXC0c5tX502q0 Date: Sat, 28 Jan 2023 16:08:31 +0530 From: Deepak R Varma To: Kashyap Desai , Sumit Saxena , Shivasharan S , "James E.J. Bottomley" , "Martin K. Petersen" , megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar , Deepak R Varma Subject: [PATCH 0/2] scsi: megaraid/megaraid_sas: Use max helper for comparison and assignment Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756262495236490221?= X-GMAIL-MSGID: =?utf-8?q?1756262495236490221?= This patch set proposes to replace the current if/else or "? :" based logical evaluation and value assignment by the recommended max() helper macro. Resultant code is better in terms of type checking and improved readability. Deepak R Varma (2): scsi: megaraid: Use max helper for comparison and assignment scsi: megaraid_sas: Use max helper for comparison and assignment drivers/scsi/megaraid.c | 3 +-- drivers/scsi/megaraid/megaraid_sas_base.c | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-)