Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4991159rdb; Sat, 30 Dec 2023 00:56:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKCNeI0PH5R0BcWMniwHayfXAPQ6EJflaqJD/0du5KMPzq9be2SuiNdjeFXBtBZcXOPnJd X-Received: by 2002:a05:6808:448d:b0:3bb:c698:76d8 with SMTP id eq13-20020a056808448d00b003bbc69876d8mr6290130oib.110.1703926574293; Sat, 30 Dec 2023 00:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703926574; cv=none; d=google.com; s=arc-20160816; b=Tbx/GQ6iMKXKA3szxBH5+XtvidEMerSUxE4ZYjiznMlqKo3XBDhE+URCmZVo9DAFeP hyoJ2d7DvPBlahkz3/PopVE8qtqZWccQ59lEI1DOepRmfYsdO6tKkJR5gOTkrWrlNnnr MQ+VXJMYuKLaaaP0Vjf4qTxxyeRW2DfQmTA6WLpumKwk3n0vgj2BHrfVNuvSAW5zkwYH 4Nft56OZwTX+/Ezse7Ua9EpXgshyHu9Boj6vaXvYUEkNn1c3K5G8H94rob6LP7cwm7yR KgeyThgqlF80VjGBW9NHcfslTC21+VV/HX8K0re3tIMkPAtqWOogWx/Zpelts3FIOXI9 z9kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:subject:cc:to:from:date:dkim-signature; bh=M3IbXD47V+68pz6eRVZ5zyb6qExz4Zb8clyjB1ECu2c=; fh=Elx0R4nY1tsf+6RifWo65N6UKW8jQ8AeZI3RnP27JnU=; b=n2zr6w6cj5vjYqR17ZfrH4j8DUTg8Eruk9+KCYOOR4K9YLeIhAifQO8lMuzftk+OX5 R7qC6qPBqnAyuTIlK569MQyEKmleHzcfXlbctRJstQyozU6sJbRgV2v0hd3PEsG+kIfr dEPu2qurd1UtfXVK4wBZP+PteA614YSnJlBqxg/gbSK8UGo+iTd4Dw75SObucmROWSIR WG6hDxv2yklx6AhNqEc00QBhn51FTw+oVPSdkb34BEWyaQ8nQkm2RCLsRp+dccN8T/7j Ru4J1QBW87eYq5caaWwss28WrT0Hc+qc7uchbpIr4tUsm0M6WvC/zBvCfACmy0kuXAtw VK8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=kPtzuGcU; spf=pass (google.com: domain of linux-kernel+bounces-13367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id gu3-20020a056a004e4300b006d9b02c9143si10786806pfb.366.2023.12.30.00.56.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 00:56:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=kPtzuGcU; spf=pass (google.com: domain of linux-kernel+bounces-13367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DEB4D28224E for ; Sat, 30 Dec 2023 08:56:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C080C20EA; Sat, 30 Dec 2023 08:56:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="kPtzuGcU" X-Original-To: linux-kernel@vger.kernel.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB322291D for ; Sat, 30 Dec 2023 08:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:message-id:mime-version; bh=M3IbXD47V+68pz6eRVZ5zyb6qExz4Zb8clyjB1ECu2c=; b=kPtzuGcUZn4BJZXKFnhzJC6swibobBy8sKGy1f6n8fQBdusFsJaTVUex qgrypwgGUM9nOB1D2NnA+bbszVU14Abz85G10S829Qc6MhAsaFXuZvxfA 4VIhz40rPx3Lrsb2VBfJarruL9ji5LRErW/9qDHgFmqsbXe7w/kfyo3NV 0=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.04,317,1695679200"; d="scan'208";a="144357072" Received: from 231.85.89.92.rev.sfr.net (HELO hadrien) ([92.89.85.231]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2023 09:56:00 +0100 Date: Sat, 30 Dec 2023 09:56:00 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Thomas Zimmermann cc: linux-kernel@vger.kernel.org, oe-kbuild-all@lists.linux.dev Subject: drivers/video/fbdev/core/fb_logo.c:67:41-42: WARNING opportunity for min() (fwd) Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII ---------- Forwarded message ---------- Date: Sat, 30 Dec 2023 15:22:13 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com, Julia Lawall Subject: drivers/video/fbdev/core/fb_logo.c:67:41-42: WARNING opportunity for min() BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: linux-kernel@vger.kernel.org TO: Thomas Zimmermann Hi Thomas, FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: f016f7547aeedefed9450499d002ba983b8fce15 commit: 8887086ef2e0047ec321103a15e7d766be3a3874 fbdev/core: Move logo functions into separate source file date: 4 months ago :::::: branch date: 11 hours ago :::::: commit date: 4 months ago config: hexagon-randconfig-r052-20231228 (https://download.01.org/0day-ci/archive/20231230/202312301511.93E0cv5e-lkp@intel.com/config) compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project d3ef86708241a3bee902615c190dead1638c4e09) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Julia Lawall | Closes: https://lore.kernel.org/r/202312301511.93E0cv5e-lkp@intel.com/ cocci warnings: (new ones prefixed by >>) >> drivers/video/fbdev/core/fb_logo.c:67:41-42: WARNING opportunity for min() drivers/video/fbdev/core/fb_logo.c:68:41-42: WARNING opportunity for min() drivers/video/fbdev/core/fb_logo.c:69:41-42: WARNING opportunity for min() vim +67 drivers/video/fbdev/core/fb_logo.c 8887086ef2e004 Thomas Zimmermann 2023-09-07 49 8887086ef2e004 Thomas Zimmermann 2023-09-07 50 static void fb_set_logo_truepalette(struct fb_info *info, 8887086ef2e004 Thomas Zimmermann 2023-09-07 51 const struct linux_logo *logo, 8887086ef2e004 Thomas Zimmermann 2023-09-07 52 u32 *palette) 8887086ef2e004 Thomas Zimmermann 2023-09-07 53 { 8887086ef2e004 Thomas Zimmermann 2023-09-07 54 static const unsigned char mask[] = { 8887086ef2e004 Thomas Zimmermann 2023-09-07 55 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff 8887086ef2e004 Thomas Zimmermann 2023-09-07 56 }; 8887086ef2e004 Thomas Zimmermann 2023-09-07 57 unsigned char redmask, greenmask, bluemask; 8887086ef2e004 Thomas Zimmermann 2023-09-07 58 int redshift, greenshift, blueshift; 8887086ef2e004 Thomas Zimmermann 2023-09-07 59 int i; 8887086ef2e004 Thomas Zimmermann 2023-09-07 60 const unsigned char *clut = logo->clut; 8887086ef2e004 Thomas Zimmermann 2023-09-07 61 8887086ef2e004 Thomas Zimmermann 2023-09-07 62 /* 8887086ef2e004 Thomas Zimmermann 2023-09-07 63 * We have to create a temporary palette since console palette is only 8887086ef2e004 Thomas Zimmermann 2023-09-07 64 * 16 colors long. 8887086ef2e004 Thomas Zimmermann 2023-09-07 65 */ 8887086ef2e004 Thomas Zimmermann 2023-09-07 66 /* Bug: Doesn't obey msb_right ... (who needs that?) */ 8887086ef2e004 Thomas Zimmermann 2023-09-07 @67 redmask = mask[info->var.red.length < 8 ? info->var.red.length : 8]; 8887086ef2e004 Thomas Zimmermann 2023-09-07 68 greenmask = mask[info->var.green.length < 8 ? info->var.green.length : 8]; 8887086ef2e004 Thomas Zimmermann 2023-09-07 69 bluemask = mask[info->var.blue.length < 8 ? info->var.blue.length : 8]; 8887086ef2e004 Thomas Zimmermann 2023-09-07 70 redshift = info->var.red.offset - (8 - info->var.red.length); 8887086ef2e004 Thomas Zimmermann 2023-09-07 71 greenshift = info->var.green.offset - (8 - info->var.green.length); 8887086ef2e004 Thomas Zimmermann 2023-09-07 72 blueshift = info->var.blue.offset - (8 - info->var.blue.length); 8887086ef2e004 Thomas Zimmermann 2023-09-07 73 8887086ef2e004 Thomas Zimmermann 2023-09-07 74 for (i = 0; i < logo->clutsize; i++) { 8887086ef2e004 Thomas Zimmermann 2023-09-07 75 palette[i+32] = (safe_shift((clut[0] & redmask), redshift) | 8887086ef2e004 Thomas Zimmermann 2023-09-07 76 safe_shift((clut[1] & greenmask), greenshift) | 8887086ef2e004 Thomas Zimmermann 2023-09-07 77 safe_shift((clut[2] & bluemask), blueshift)); 8887086ef2e004 Thomas Zimmermann 2023-09-07 78 clut += 3; 8887086ef2e004 Thomas Zimmermann 2023-09-07 79 } 8887086ef2e004 Thomas Zimmermann 2023-09-07 80 } 8887086ef2e004 Thomas Zimmermann 2023-09-07 81 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki