From patchwork Wed Feb 16 09:09:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 543274 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 88714C433F5 for ; Wed, 16 Feb 2022 09:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231904AbiBPJJV (ORCPT ); Wed, 16 Feb 2022 04:09:21 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:56658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231903AbiBPJJU (ORCPT ); Wed, 16 Feb 2022 04:09:20 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 050A1255AF for ; Wed, 16 Feb 2022 01:09: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=1645002549; x=1676538549; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=99YnMQbApcc0QAzHaMFoAdEXgK/fCyyygtJXRBUm/tc=; b=j4gHnwg8D4KEuB/c/xSGNz4P80PCf3/7HHruMEdjsC2hIoad5FHl1CKe nVY39vyqNKqP2L6FdSRNkmin+Dy4bPDV0MqX0wi7Xx934psUiLuucjb7j 76EIMbdMIaUN+HfwskpivAS9w3RLjFweMLkt0g+AwR86UfP7MQGvoGkro bxtBY9EBE1wx+R0Henx3kRvVhOMvNEYCrqpGlBJMd6BfKb2fijfzNYpVQ S9V1O5MO2dd0A1YafZHeMAwNKphVZa+QCcqVHwsWBpdfuxau+3ZgUqs8W mERh11W6M6XwXxNtKoelkds/hF1O+KxAUeLoZA56yfeyUV+DE1dfKiIMF Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="313831511" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="313831511" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 01:08:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="571190425" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by orsmga001.jf.intel.com with ESMTP; 16 Feb 2022 01:08:20 -0800 From: Mathias Nyman To: Cc: , kernel test robot , Julia Lawall , Mathias Nyman Subject: [PATCH 9/9] usb: xhci: fix minmax.cocci warnings Date: Wed, 16 Feb 2022 11:09:38 +0200 Message-Id: <20220216090938.1260899-10-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220216090938.1260899-1-mathias.nyman@linux.intel.com> References: <20220216090938.1260899-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,