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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT 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 CC831C072B5 for ; Fri, 24 May 2019 13:57:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF88B2070D for ; Fri, 24 May 2019 13:57:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404042AbfEXN5q (ORCPT ); Fri, 24 May 2019 09:57:46 -0400 Received: from mga12.intel.com ([192.55.52.136]:30660 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403843AbfEXN5p (ORCPT ); Fri, 24 May 2019 09:57:45 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 May 2019 06:57:44 -0700 X-ExtLoop1: 1 Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by orsmga007.jf.intel.com with ESMTP; 24 May 2019 06:57:43 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hUAha-0003ec-Oc; Fri, 24 May 2019 16:57:42 +0300 Date: Fri, 24 May 2019 16:57:42 +0300 From: Andy Shevchenko To: Daniel Lezcano Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 4/9] genirq/timings: Use the min kernel macro Message-ID: <20190524135742.GX9224@smile.fi.intel.com> References: <20190524111615.4891-1-daniel.lezcano@linaro.org> <20190524111615.4891-5-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190524111615.4891-5-daniel.lezcano@linaro.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 24, 2019 at 01:16:10PM +0200, Daniel Lezcano wrote: > The' min' is available as a kernel macro. Use it instead of writing > the same code. While it's technically correct... > /* > * 'count' will depends if the circular buffer wrapped or not > */ > - count = irqs->count < IRQ_TIMINGS_SIZE ? > - irqs->count : IRQ_TIMINGS_SIZE; > + count = min_t(int, irqs->count, IRQ_TIMINGS_SIZE); > > start = irqs->count < IRQ_TIMINGS_SIZE ? > 0 : (irqs->count & IRQ_TIMINGS_MASK); ...looking to the context I would leave as is to have a pattern. -- With Best Regards, Andy Shevchenko