Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2145581pxb; Wed, 9 Feb 2022 11:49:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3KQk+67apC5RO/x2N9/e6/c4N9rQNJtFZrD/f2ZdmWfqdwN3THgKyiZEiLSF6k1Bx/6vr X-Received: by 2002:a63:2707:: with SMTP id n7mr3197804pgn.244.1644436170948; Wed, 09 Feb 2022 11:49:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644436170; cv=none; d=google.com; s=arc-20160816; b=Eub+aVo2ZulfRQ03Jhp0qgu1TkKqh8bhK0aL6YIb2qpxyOuELr92rainvTRlwt56Lt ymI5W9VzbqbkIuClU3EvjD6ERqiwLSbtN28LHZ80ec1OH3nk4L9FAF6aAoV5o5UP+TRm ybZn+xNDJiux74ocL4uJCoath9XTe5iL+HlE/eZ29Gcj9ua5NC5Ma13L61zrPTgACq/e gY7QLTIRjVGYiI2wJAcwaRd9al3m/xVUPmt2t0m9pquKCJhD8WQMtHMnhzL4uIrfvNQi J0f7QX3oCFySa4stFrjMqIIjfepBtYyzHs4RuAxn6sNsynrAwwkprC9DHVvPHCgCKqJk WMdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Ul1n7DCtU+yR3fyR72ZjUGs05kWWl+Y9NjuSTr15dNM=; b=U3z64CNl+Yfq5laFLPbdkk6f6HGWjgw05V51mAmHoCprHQEb3cN1KSx0LoAePLhMoG CIyWwzqKmW3vHPhDbkA+YoTrvOScfubELvMRnKMM1bwARHS684gfIdVQotiWX8h9xPp2 Kshbcg21wetKalds2XHwLGcpIk2G62HZ67PmM4Zfbe5IBNXVI4fQ8eBNpyKCteXLpGFe nKWccevTk1ohMzKDDY2VGUBf9RA7mKwmp3nL2R8AtzpZxEluyClA9VjE1cArbkhcEzS1 GDYcWBJAJvHD/VCLs1771TriP2gH6tZxEmW8mZVthzJxCRziMAfq91Tb0mAqSXKiGMVP hE3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u11si9496797pfi.306.2022.02.09.11.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:49:30 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 64ECBE035E19; Wed, 9 Feb 2022 11:44:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241182AbiBIS45 (ORCPT + 99 others); Wed, 9 Feb 2022 13:56:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242106AbiBIS4e (ORCPT ); Wed, 9 Feb 2022 13:56:34 -0500 Received: from mx2.smtp.larsendata.com (mx2.smtp.larsendata.com [91.221.196.228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D82DC02B66F for ; Wed, 9 Feb 2022 10:54:36 -0800 (PST) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx2.smtp.larsendata.com (Halon) with ESMTPS id decf265d-89d9-11ec-ac19-0050568cd888; Wed, 09 Feb 2022 18:55:38 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 962EC194B52; Wed, 9 Feb 2022 19:54:28 +0100 (CET) Date: Wed, 9 Feb 2022 19:54:25 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: cgel.zte@gmail.com Cc: deller@gmx.de, linux-fbdev@vger.kernel.org, ducheng2@gmail.com, penguin-kernel@i-love.sakura.ne.jp, daniel.vetter@ffwll.ch, Zeal Robot , deng.changcheng@zte.com.cn, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, cssk@net-c.es, geert@linux-m68k.org, svens@stackframe.org Subject: Re: [PATCH] fbcon: use min() to make code cleaner Message-ID: References: <20220209084810.1561184-1-deng.changcheng@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220209084810.1561184-1-deng.changcheng@zte.com.cn> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Wed, Feb 09, 2022 at 08:48:10AM +0000, cgel.zte@gmail.com wrote: > From: Changcheng Deng > > Use min() in order to make code cleaner. > > Reported-by: Zeal Robot > Signed-off-by: Changcheng Deng Reviewed-by: Sam Ravnborg I had preferred in minmax.h was included, but it has an indirect include so shrug. I assume Daniel or Helge will pick it up. Sam > --- > drivers/video/fbdev/core/fbcon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > index f36829eeb5a9..61171159fee2 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -602,7 +602,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, > save = kmalloc(array3_size(logo_lines, new_cols, 2), > GFP_KERNEL); > if (save) { > - int i = cols < new_cols ? cols : new_cols; > + int i = min(cols, new_cols); > scr_memsetw(save, erase, array3_size(logo_lines, new_cols, 2)); > r = q - step; > for (cnt = 0; cnt < logo_lines; cnt++, r += i) > -- > 2.25.1