Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2074837lqb; Mon, 27 May 2024 07:09:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIhCD16hVtV5xZJ2RC3jUig9WQoOK9BXzm51LeJwifo4dbnQlUut5vQLsIA2CgSCJ8bPbxb9M6d1dpMfr6aB+Nf0sVTRNiaNEkMGjyHA== X-Google-Smtp-Source: AGHT+IHNvasqawg7GFJf0x2XWIt7mFE4eeh7rntyg1RQzadZJlo0eKFd4fB1/ZgPc5yy4/zckCvV X-Received: by 2002:a05:6808:309f:b0:3c9:d067:1de9 with SMTP id 5614622812f47-3d1a6111ac2mr12472010b6e.34.1716818975698; Mon, 27 May 2024 07:09:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716818975; cv=pass; d=google.com; s=arc-20160816; b=Q/pxCDAl7hyaUVTeFOhfLyk29bh4adLlTw1Y8JmxK5mTRCl4cwDdW3h40NDZSkVlrg HCFl7Gc+EDH0yq2yWtBr+pUHBEZLCzoJUIzq3MYV44/nWvVZVLJd445MVw6WtUl5WmZV f1823POFN41gFdGbhhWibvKOo2kCeMVWw5g6jVAEIHjcO9+HHdJwt7xyo0iNlNNxspDF hQQ70NPXl2TXYB4thSp+sTfam+KrjzFU2ZV+1Ybr8VaoC0WPF9QB3AnqEWoCRViink3/ s33ycDt+17WrhnIRXEXH8zG8wA6r424yYsst3En20fHFcxKTPQ+6MJGa84S+KYsZYnhN gqaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=GWHMYYFc0vmLVfRxMP1ZHbpXtdWBDPfQyF/yH4lbn5M=; fh=zCKs/35Tkdt6Xx06d9liXWln0e1oNYS8g96AOoWF6tU=; b=nfmlBU99pGvbLKkIwl+N32Lm0oSOHSXgH3t9sfcaIvIac8yz5MGMdQC9AVCCzfnetG AzM60cAw2P3mTBt0qCgIdgv/bttsd5FsPJSrknYW3pa1Eah56hx1BVrHeze5yNkr3rB8 qTwkHANzWsFugRIOHrKXLsWtGnWb03udtT9TnJ7RoU3SWpdMgo0B+Mbuw4/GK9rZpsJg z+wzRQtLc8FW3aLgLCXsEsVBEygdEctG0LS6W29XJxZbGcHJfcLHsn2yuZkV+JSqsT94 eqBZ8tj65gHozKjq4Ut8MmestaEVlusmvy56KiCYPXnDqiTUjafQdaw1g5O0CM4m38NA hEiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i2fkXIN3; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-190799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48a3a3e4eadsi1536283137.701.2024.05.27.07.09.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i2fkXIN3; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-190799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 674FA1C20BB0 for ; Mon, 27 May 2024 14:09:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CD681E4AE; Mon, 27 May 2024 14:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="i2fkXIN3" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 5347DF503 for ; Mon, 27 May 2024 14:08:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716818921; cv=none; b=bC/4/N5EVJu6e0QDgZXWO3GTCVMDl97SzS5HfiHjA9Jn1xOIiV3/MovwPOir2I+iJ06E6ki2Fd16TFTviHqsTK/9iWTPPXI5Iwrc45pidCnyRIM1L4kNR5YErwoyL2odF308PQPEdP6E2JluMtzwZv1vG8mieyYv8DoysLlDm7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716818921; c=relaxed/simple; bh=ZXwbZiy8td+gubmN1p/8TtpDqubSKNzO4ViE717nqXo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=I13oI6NSMSjtdgyG5s8dx8aYZhfuqfnt0HhVmMfDnBfi1rvY2+7JaEmLJjPb1ud3/lK6fybkaJV74sM4D79NDu4T3VK1iTx3QPpimpF03OehgbV3N7EoDjeC6hqknGCpMGssPvLH5NQ73cAlCZ8GSr/dm6i/l3ANf7MPm9/eJJU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=i2fkXIN3; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716818921; x=1748354921; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=ZXwbZiy8td+gubmN1p/8TtpDqubSKNzO4ViE717nqXo=; b=i2fkXIN3qIZXOB6GjN8+mdHyAdSxcYPQrg4uqgFOaN5L+oxERO6bMHW6 2fLcZoiLTlIFRMge9mHZ8O7/DlC3LSQH2isSURHETggYYomos77puKs91 BEhH+FXlOffStyKDfwbNmT/xHwISpc/mpZ/DHUVLD30a3vH6Nycje4UP8 A3SBtftCVqQVa/oPcvTUIryrllkOEFQ+bhg4uQr6MMUyLZiQi+cvmY4xH 71rsqSjHv5bhxpS2wnaXo2K1osDORWq6DUairG4zBR4+4pFpgRRr777w/ t0D/qx4dWSMhODTC3/8R8UJcZN5E+y8GMs39x7Ck8JwmsbKxm27PFXlI3 w==; X-CSE-ConnectionGUID: AtWyVuEjTjqpSOl6Ht7E5A== X-CSE-MsgGUID: CaAhchByRZO2TYEyAtGTOA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13314252" X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="13314252" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 07:08:40 -0700 X-CSE-ConnectionGUID: WclyaCNiQxKBcSASf3gFJQ== X-CSE-MsgGUID: e/YtuAi0SRKK8zGxEOOCBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="39318700" Received: from lfiedoro-mobl.ger.corp.intel.com (HELO localhost) ([10.245.246.200]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 07:08:37 -0700 From: Jani Nikula To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Kees Cook , Andy Shevchenko Subject: Re: [PATCH 2/2] drm: use mem_is_zero() instead of !memchr_inv(s, 0, n) In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20240527094320.2653177-1-jani.nikula@intel.com> <20240527094320.2653177-2-jani.nikula@intel.com> Date: Mon, 27 May 2024 17:08:34 +0300 Message-ID: <87h6ejmjod.fsf@intel.com> 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=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, 27 May 2024, Andy Shevchenko wrote: > On Mon, May 27, 2024 at 12:43=E2=80=AFPM Jani Nikula wrote: >> >> Use the mem_is_zero() helper where possible. > > ... > >> - if (memchr_inv(guid, 0, 16) =3D=3D NULL) { >> + if (mem_is_zero(guid, 16)) { >> tmp64 =3D get_jiffies_64(); >> memcpy(&guid[0], &tmp64, sizeof(u64)); >> memcpy(&guid[8], &tmp64, sizeof(u64)); > > What is the type of guid? Shouldn't it be guid_t with the respective > guid_is_null() I can leave out these parts of the patch. BR, Jani. > > ... > >> - if (memchr_inv(guid, 0, 16)) >> + if (!mem_is_zero(guid, 16)) >> return true; > > Ditto. --=20 Jani Nikula, Intel