From patchwork Wed Feb 16 09:51:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 544063 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 7E027C433EF for ; Wed, 16 Feb 2022 09:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbiBPJvf (ORCPT ); Wed, 16 Feb 2022 04:51:35 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:49000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232478AbiBPJvb (ORCPT ); Wed, 16 Feb 2022 04:51:31 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA19A29C103 for ; Wed, 16 Feb 2022 01:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645005068; x=1676541068; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=99YnMQbApcc0QAzHaMFoAdEXgK/fCyyygtJXRBUm/tc=; b=WQXsblzsf6t+Hq6tYh8HLLlZVruf6bilJBq+OXERPCd2LghY+S+mMUkj Dqn/ut3g4SrnKa3IqBbcC+C90+v/w2d9NV5FzQ6Ed+19ObNP6xwXC3B2j p3Foz/QJpOhD+7DlbFK9uMYQQQJilEYl8qzKBchznl5S/2u7y3oiYH1Ty LbUCmHiHTTMQB1uC3fsi5vuYzxIsvK3uh4b1OsbCRnl2i+ZAulTpTM9bq lM343t5BqYOVhoedQStpmEJ+p8hyZFEr3cI31oB/dhdFMKrhBrOAUZpHl QdMEhwlDHYEm4ZMIGFRWvvhCcIc1QdyadXTv/E8oBRBhvRd38L/4fqz8D g==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="249396978" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="249396978" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 01:50:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="636410414" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by orsmga004.jf.intel.com with ESMTP; 16 Feb 2022 01:50:34 -0800 From: Mathias Nyman To: Cc: , kernel test robot , Julia Lawall , Mathias Nyman Subject: [PATCH v2 9/9] usb: xhci: fix minmax.cocci warnings Date: Wed, 16 Feb 2022 11:51:53 +0200 Message-Id: <20220216095153.1303105-10-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220216095153.1303105-1-mathias.nyman@linux.intel.com> References: <20220216095153.1303105-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: kernel test robot Simplify the code using max(). Generated by: scripts/coccinelle/misc/minmax.cocci Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 7a2dce730e9a..f8c2b6c79543 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -433,8 +433,7 @@ int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring, (TRBS_PER_SEGMENT - 1); /* Allocate number of segments we needed, or double the ring size */ - num_segs = ring->num_segs > num_segs_needed ? - ring->num_segs : num_segs_needed; + num_segs = max(ring->num_segs, num_segs_needed); ret = xhci_alloc_segments_for_ring(xhci, &first, &last, num_segs, ring->cycle_state, ring->type,