Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2938614pxy; Mon, 3 May 2021 11:16:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBEyjGLJmeb+wLjnAMeJE0hmHs9bk3U6zUvA8h9B0+/fUmaAuTRWGA31iTPBW3MGT3jyP/ X-Received: by 2002:a65:4c89:: with SMTP id m9mr19150212pgt.330.1620065816518; Mon, 03 May 2021 11:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065816; cv=none; d=google.com; s=arc-20160816; b=QdleJ0l5SQzVm5l29g0EhTCbv+R9SP1QMLAUWtmntIs7//DiStjThu8SS4TQI1Hj1i eK6uNnZ5ioeRC1txuDY+gyqS9keoZSeItceyMr5sfq/Lp0h7elvIhFedIqlgRjCVZcTn uORVUeH80EGLSUbdw0PjTpl59gYrtGQvLs/HU/N6JyuE+68249WNNVLhnghHM77wzXgn L+QssoKVT2qfuSpv85JGOlEc1IJOWuhFkM7sC+AiwMTlHO+q4KOtlgvcDzmwATJcTOte 7rWLV2TnkRIhqgDIzgnrEygmbgV6M72aI1lveCHpJTEQ+Ly8Z1DhE1OXDS+riD4ieDM2 8e6A== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-hdrordr:dkim-signature; bh=6mxhGQkf6oLkj694Z0olsm1mGeEewomsdUC85Z8kldA=; b=atHsng1/DiPEUilsG/5AsXFM5HS/5CsZXK3Nr0Nw+iDfRFpxDUaYGODe7xrKTbStcN C5+6XrZJMSFSSFWEQxC5kCcG9S7x/blrIytmnHcmXxWte6xyok7aZO22ED2LbZysiVZ0 VvVs+Ot9bgxqzzOH3k9x9X8oTuBNePsAjlGjDeEZfd/tFDtN0cGAm1DoVVjpphsG0+Fg 4QtBjLgo0tlNYQdeNL0CHN7j87TwN+K3CGpOWjFoR+5erB3ICge6yYBadD10NwjV684W K6ouvV0KymRpve2R4zpXspu2UNFxNWWM8r9/4JmyOPyHjWsvOGEpmrJPcD0bvYEcx1E+ JtFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=hzQfZG2h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x7si446700plo.360.2021.05.03.11.16.44; Mon, 03 May 2021 11:16:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=hzQfZG2h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231623AbhECSHw (ORCPT + 99 others); Mon, 3 May 2021 14:07:52 -0400 Received: from alln-iport-5.cisco.com ([173.37.142.92]:52760 "EHLO alln-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231513AbhECSHv (ORCPT ); Mon, 3 May 2021 14:07:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=993; q=dns/txt; s=iport; t=1620065218; x=1621274818; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=7X2Sx/02p8jds+5OouAKIoXCEMD74/3FvpAFk7V449g=; b=hzQfZG2hw2tREhgBr7VhHJw5OOiliOsEXxNA/Bdr9KfIQrmyos0y3XOl Ozryp1VEiOVkvL9+MsN7/MhspoLzi237/WHRfzTHy/F2/NxNqyfwLvwc6 74yVjM1FKabWzEZepExFuQ1ijNBFrcGbH8xY74EAVETAtvPW9Fkga8oKz k=; X-IPAS-Result: =?us-ascii?q?A0ABAACVOpBgmIkNJK1aGQEBAQEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?RIBAQEBAQEBAQEBAQFAgUMEAQEBAQELAYMhVgE5MYxoiVKQG4pkgXwLAQEBD?= =?us-ascii?q?QEBKAwEAQGBFgGCdT8DAgKBewIlNAkOAgQBAQEDAgMBAQEBAQUBAQECAQYEF?= =?us-ascii?q?AEBAQEBAQEBaIVQDYZFAQUyAUYQCxguPBsGgwQBgwcPqBt4gTSBAYNcQYQOg?= =?us-ascii?q?T4GFA+BFwGNXyccgUlChDc+gmABAgGHVgSBZYIaAoFMgSiRHI03nD6DGoEom?= =?us-ascii?q?3Y3EKUSLbhiAgQGBQIWgVQ4gVszGggbFYMkUBkOjjiIa4VpIQMvAjYCBgoBA?= =?us-ascii?q?QMJjQ8BAQ?= IronPort-HdrOrdr: A9a23:UuRB3K4c3ftbjkInKwPXwbKBI+orLtY04lQ7vn1ZYxY9SKOlvu qpm+kW0gKxpTYKQXc7mc2BPq7oewK4ybde544NMbC+GDT8sGyzI414qafkyTvsGyrxn9QtsZ tIWa54FdH2EBxGnd/3iTPIceoI7dGb/MmT79v24GxqSWhRBp1IzwA8MQqDF10zeQ8uP+tfKL O5xu5q4wWtYm4WaMPTPAhnY8Hmq8fQnJzrJT4qbiRH1CC0gTml6KH3HnGjt390bxp1zbgv6m TDmQDij5/Cj9iA1hTe22XPhq45pPLdzLJ4aPCku4w8Nijrzj2lfp1mXKeP+Aooufi15Ewx+e O8xSsIDoBU927beH2zrF/L3QTtuQxek0PK+Bu/nWbpp9D/SXYBL/d5wahdchff9iMbzahB7J 4= X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="5.82,270,1613433600"; d="scan'208";a="708392964" Received: from alln-core-4.cisco.com ([173.36.13.137]) by alln-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 03 May 2021 18:06:57 +0000 Received: from zorba ([10.24.21.191]) by alln-core-4.cisco.com (8.15.2/8.15.2) with ESMTPS id 143I6tWd008213 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 3 May 2021 18:06:56 GMT Date: Mon, 3 May 2021 11:06:54 -0700 From: Daniel Walker To: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, x86@kernel.org, Andrew Morton , xe-linux-external@cisco.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] lib: early_string: allow early usage of some string functions Message-ID: <20210503180654.GP3844417@zorba> References: <20210430042217.1198052-1-danielwa@cisco.com> <1929b3a8-f882-c930-4b99-10c6a8f127c7@csgroup.eu> <20210503180141.GO3844417@zorba> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210503180141.GO3844417@zorba> X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-SMTP-Client: 10.24.21.191, [10.24.21.191] X-Outbound-Node: alln-core-4.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 03, 2021 at 11:01:41AM -0700, Daniel Walker wrote: > On Sat, May 01, 2021 at 09:31:47AM +0200, Christophe Leroy wrote: > > > > > In fact, should be like in prom_init today: > > > > > > #ifdef __EARLY_STRING_ENABLED > > > ????if (dsize >= count) > > > ??????? return count; > > > #else > > > ????BUG_ON(dsize >= count); > > > #endif > > > > Thinking about it once more, this BUG_ON() is overkill and should be > > avoided, see https://www.kernel.org/doc/html/latest/process/deprecated.html > > > > Therefore, something like the following would make it: > > > > if (dsize >= count) { > > WARN_ON(!__is_defined(__EARLY_STRING_ENABLED)); > > > > return count; > > } > > I agree, it's overkill it stop the system for this condition. > > how about I do something more like this for my changes, > > > > if (WARN_ON(dsize >= count && !__is_defined(__EARLY_STRING_ENABLED))) > > return count; I'll have to work on this one.. Daniel