Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp150296rwi; Sun, 9 Oct 2022 20:32:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78yjXrSj/N6FaoXeSy0QZPueiMXSxeDJYbY7JllrQE+SfXe8tsiQJEaTGXhQwJpo+wmTMy X-Received: by 2002:a65:5801:0:b0:45d:bbd8:e872 with SMTP id g1-20020a655801000000b0045dbbd8e872mr13685907pgr.343.1665372753454; Sun, 09 Oct 2022 20:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665372753; cv=none; d=google.com; s=arc-20160816; b=JEVKifqXfyKHL1l3qxD9ISGlZaZ32WCpB5c0gaXxk1YRjMeZ115mS/UYCdAc9qoM2b p1J47SS2kpqsGImElSOPeBhCRA94Fefveml7Uz451IFf2bcJ/qvHBgRkoxAC2EUp38W1 njbTwavBoHnQD27PBCDgzaNinjU2hHxZKPwLVM3Skry8hOURsYUgHYq9BnYZITYUmBr8 dC4gRHQebgb3CKjh1fgig9VpzDzcc7iLMkJZrAeTgezukXIspUyP/qH8wiZzvg2uEWCK R/aiReV8aqph/4rZxQIddfeQIsVI1sAfYY3yQ+GBT3B8rILkzpKzgjVmuBR7X8+t01U+ VThw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from; bh=rj2YACoUxsOC4b1tOMvZBmZa4rJeDQr+DbsaURQ2WiA=; b=a79vFb7miwgn139ndsfOk4OkNcL+uhWz7OYECua3Wt88XKamz0mFNsF01ROoRXdH3H O6xnMWIwNxX3HAd9tq6hcFZVe8+aA4VzIY8vSN09WlnLQsaPQqzKhpXtINx2SBRWOVWv utuCDk+QgoWeMiU3JVTZIros529nlhYm70lxwpASJuE3Vxe0YZlImZtuC2C7lOx2zCbJ bKZkT6QkLw3+Ku/8x/1DBNx6c6ZrPSMfK6E21ZB0W+Ifb6GVTx0GSd5QAYjCPR7Ab0nV LnpyPI2wb+JlFweBXQyKKvtWIdGS8d67t0qTRdLVEGVe2Kz5HZUa85MldmshmE6Y0BAj lEZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lohu.info Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a170902da8c00b0017f802fcffesi12317335plx.410.2022.10.09.20.32.20; Sun, 09 Oct 2022 20:32:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lohu.info Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230253AbiJJDDV convert rfc822-to-8bit (ORCPT + 99 others); Sun, 9 Oct 2022 23:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiJJDDR (ORCPT ); Sun, 9 Oct 2022 23:03:17 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7143C5072D for ; Sun, 9 Oct 2022 20:03:13 -0700 (PDT) X-QQ-mid: bizesmtpipv601t1665370964tu3d Received: from SJRobe ( [255.214.198.8]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 10 Oct 2022 11:02:43 +0800 (CST) X-QQ-SSF: 01100000000000G0Z000000A0000000 X-QQ-FEAT: zT6n3Y95oi1z8zdxsRWsbSlFVf0jAbvLSoajH5gkEwqRkOVI8QkH2Ra5iUvbH Oj4eE6T8UFOfHFQldxBEmSjURTiZup/pkTP9hghp1K2FiLLiKAtVATuZ+oSgAHvyRF42mb7 kE2MLM2bJ6ZltFWRLJTo9B8QMGKqfxIMmzfFXFBHv6Mn0ah6ZPmgpzRYB3zOholqeMze7YB dgzDd4Ecaf9/An2zUPmCPfbT29G/jVXUcQ3v/ZP6tt4Mr/jT1iDWCeY+FyEd5DUK7uCCh94 ZtUvbEFHrZI9qqFv0bWTONoALlNs+L9e3JDHbPLHJt3vcCFF19hROHp5BKaFbdFlIxUyVmP j448JuWGDRFzRHs+VTs7vHLOzEzGyMGS3j9VGT30IlunvQ2kNqs1EgjK6LmsxhJ/FfSoiLH X-QQ-GoodBg: 0 From: "Soha Jin" To: "'Greg Kroah-Hartman'" Cc: "'Rafael J. Wysocki'" , "'Andy Shevchenko'" , "'Daniel Scally'" , "'Heikki Krogerus'" , "'Sakari Ailus'" , References: <20221009162155.1318-1-soha@lohu.info> <20221009162155.1318-2-soha@lohu.info> In-Reply-To: Subject: RE: [PATCH 1/3] string: add match_string_nocase() for case-insensitive match Date: Mon, 10 Oct 2022 11:02:39 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJ3YxYd+FPcuiJVmWEOx+0wAFDAtAEC1QTIAidE926ssJJBUA== Content-Language: fr X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpipv:lohu.info:qybglogicsvr:qybglogicsvr3 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_ILLEGAL_IP, SPF_HELO_NONE,SPF_PASS 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 Hi Greg, > On Mon, Oct 10, 2022 at 12:21:53AM +0800, Soha Jin wrote: > > Sometimes we want to make a case-insensitive comparison with strings, > > like checking compatible devices in fwnode properties, so this commit > > abstracts match_string to __match_string with a compare function. The > > original match_string will call __match_string with strcmp, and the > > new match_string_nocase will call it with strcasecmp. > > Wait, no, fwnode properties are case sensitive, why are you allowing that to > be changed? That sounds like broken firmware to me, right? > I am writing regarding the compatibility. In `of_device_is_compatible`, it uses `of_compat_cmp` which calls `strcasecmp` to match compatible property. As the `fwnode_is_compatible` should be the replacement of the OF way, I think we should make the fwnode way and the OF way the same, i.e. either both case-insensitive or case-sensitive, to keep the consistency. I am afraid that make `of_compat_cmp` case-sensitive may break a great many of devices, that is why I am doing this. Regards, Soha