From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C04E2C433E0 for ; Thu, 4 Feb 2021 22:59:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 740F564FAD for ; Thu, 4 Feb 2021 22:59:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbhBDW73 (ORCPT ); Thu, 4 Feb 2021 17:59:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:37776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbhBDW71 (ORCPT ); Thu, 4 Feb 2021 17:59:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 38E5D64FAC; Thu, 4 Feb 2021 22:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612479526; bh=x7XJkzjV+9hwJNvlgLRyMG4w5s/WquVgMBsSG5Lp89Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BPqdRmd/NPPTZAYOee+Z3Sm/tdPp+ibXDbht6u7CE9Fdxd0DXyzJV3Ir8pnq5q066 3wRb4IMnV+4hvgGhNZC/WUcTzKvIxL0aEs5UEEs0yxbRZiltEf51suucEb1VIHRtvM ROdlXPVE7yJUKIrrqu9jhpon9xLbAmFUje+U8Ynavu1HObsiQfwXKTlfX5vVEOXt/W ZTbF20VTTz20pkz3BmV9xSvchoVMzNNcutEBLnEzMH3c9vMYzIl7cEr4NSA/OTowmd JKn96K8fQFpiQxa2u17Ws/u36ofp1XKG6jDEAuRELFvOWnvEq+rsIZ/VaTZVzMeKhF Mhvil6CmwXaDw== Date: Thu, 4 Feb 2021 15:58:44 -0700 From: Nathan Chancellor To: ameynarkhede02@gmail.com Cc: manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, gregkh@linuxfoundation.org, netdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: qlge/qlge_main: Use min_t instead of min Message-ID: <20210204225844.GA431671@localhost> References: <20210204215451.69928-1-ameynarkhede02@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210204215451.69928-1-ameynarkhede02@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 05, 2021 at 03:24:51AM +0530, ameynarkhede02@gmail.com wrote: > From: Amey Narkhede > > Use min_t instead of min function in qlge/qlge_main.c > Fixes following checkpatch.pl warning: > WARNING: min() should probably be min_t(int, MAX_CPUS, num_online_cpus()) > > Signed-off-by: Amey Narkhede > --- > drivers/staging/qlge/qlge_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c > index 402edaeff..29606d1eb 100644 > --- a/drivers/staging/qlge/qlge_main.c > +++ b/drivers/staging/qlge/qlge_main.c > @@ -3938,7 +3938,7 @@ static int ql_configure_rings(struct ql_adapter *qdev) > int i; > struct rx_ring *rx_ring; > struct tx_ring *tx_ring; > - int cpu_cnt = min(MAX_CPUS, (int)num_online_cpus()); > + int cpu_cnt = min_t(int, MAX_CPUS, (int)num_online_cpus()); You should remove the cast on num_online_cpus() like checkpatch suggests. min_t adds the cast to int on both of the inputs for you. > > /* In a perfect world we have one RSS ring for each CPU > * and each has it's own vector. To do that we ask for > -- > 2.30.0 Cheers, Nathan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5ADAC433DB for ; Thu, 4 Feb 2021 22:58:52 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 267E464FAE for ; Thu, 4 Feb 2021 22:58:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 267E464FAE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A210D87267; Thu, 4 Feb 2021 22:58:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6FEHbmUWuI6i; Thu, 4 Feb 2021 22:58:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1C46E8728A; Thu, 4 Feb 2021 22:58:49 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E07501BF32C for ; Thu, 4 Feb 2021 22:58:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DD00A868D0 for ; Thu, 4 Feb 2021 22:58:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RtzW_8SDeoyS for ; Thu, 4 Feb 2021 22:58:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 368BF868F3 for ; Thu, 4 Feb 2021 22:58:47 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 38E5D64FAC; Thu, 4 Feb 2021 22:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612479526; bh=x7XJkzjV+9hwJNvlgLRyMG4w5s/WquVgMBsSG5Lp89Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BPqdRmd/NPPTZAYOee+Z3Sm/tdPp+ibXDbht6u7CE9Fdxd0DXyzJV3Ir8pnq5q066 3wRb4IMnV+4hvgGhNZC/WUcTzKvIxL0aEs5UEEs0yxbRZiltEf51suucEb1VIHRtvM ROdlXPVE7yJUKIrrqu9jhpon9xLbAmFUje+U8Ynavu1HObsiQfwXKTlfX5vVEOXt/W ZTbF20VTTz20pkz3BmV9xSvchoVMzNNcutEBLnEzMH3c9vMYzIl7cEr4NSA/OTowmd JKn96K8fQFpiQxa2u17Ws/u36ofp1XKG6jDEAuRELFvOWnvEq+rsIZ/VaTZVzMeKhF Mhvil6CmwXaDw== Date: Thu, 4 Feb 2021 15:58:44 -0700 From: Nathan Chancellor To: ameynarkhede02@gmail.com Subject: Re: [PATCH] staging: qlge/qlge_main: Use min_t instead of min Message-ID: <20210204225844.GA431671@localhost> References: <20210204215451.69928-1-ameynarkhede02@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210204215451.69928-1-ameynarkhede02@gmail.com> X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, GR-Linux-NIC-Dev@marvell.com, manishc@marvell.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Fri, Feb 05, 2021 at 03:24:51AM +0530, ameynarkhede02@gmail.com wrote: > From: Amey Narkhede > > Use min_t instead of min function in qlge/qlge_main.c > Fixes following checkpatch.pl warning: > WARNING: min() should probably be min_t(int, MAX_CPUS, num_online_cpus()) > > Signed-off-by: Amey Narkhede > --- > drivers/staging/qlge/qlge_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c > index 402edaeff..29606d1eb 100644 > --- a/drivers/staging/qlge/qlge_main.c > +++ b/drivers/staging/qlge/qlge_main.c > @@ -3938,7 +3938,7 @@ static int ql_configure_rings(struct ql_adapter *qdev) > int i; > struct rx_ring *rx_ring; > struct tx_ring *tx_ring; > - int cpu_cnt = min(MAX_CPUS, (int)num_online_cpus()); > + int cpu_cnt = min_t(int, MAX_CPUS, (int)num_online_cpus()); You should remove the cast on num_online_cpus() like checkpatch suggests. min_t adds the cast to int on both of the inputs for you. > > /* In a perfect world we have one RSS ring for each CPU > * and each has it's own vector. To do that we ask for > -- > 2.30.0 Cheers, Nathan _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel