Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3703018pxm; Tue, 1 Mar 2022 03:54:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzlUd3WuJiyLPxfbyWHPpjh+Z4PNB9vhlCamBY+K/y5yYCNk2IbrcYGo4oNZ3MFw7EdOja X-Received: by 2002:a63:305:0:b0:374:2e45:e3d7 with SMTP id 5-20020a630305000000b003742e45e3d7mr21196240pgd.473.1646135644744; Tue, 01 Mar 2022 03:54:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646135644; cv=none; d=google.com; s=arc-20160816; b=WocCjrOOOae1H19aalyvE5b+6bFHyiATVEF2Z/E/oWDrSatYp0Jk+bbzhMZcA+iu22 Gm68c1Xfcn723/5tW0qpqk89K5iJrXjXBzAFcgx3/dxFkwpiWLx3CqLtRxDU4AauihGa XYqHJI23tXiGrjW+NzD5WyMtbwfzzsi2OdrmkgeJD4HuX8R+1S5AYYXtJ0tZHG44HLvv l2iUazDjw/bOeAZJSW6fIUWXQcO8lDiQgjqwG1oxVvuRSw7QMBWphZ64a6+ATExKA7DV Nw9E6YPFiJLvrUptwqe8oQd72/CQOnhKC519VjXvi0Os9ulpCQHcph1iqhnQamvkAxn7 CqCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=i5oNvJtWT2nQMVMnHuzSOVOeJhkbSN882hqbqowwmW8=; b=0Wkp4bGhaIy8D7QGhGRMDcSzyaONjoi0Lg1TEdvurJbs9z8cZLBh7uTO46hCSpKnw9 p0BNxtOEfcqYzmsjKpUj4liH7U3j/cYyR533Tm6Z9ln48lUyJm4u4JnW8S2PKBrLMfKQ XjPhVaNpdA7xe0DdLokMvHY621Qgj9wQq31hgMj0BFbWQX2rE7/huyaTMluAxwJwfHpp zs8CyPxdDSj4rh5TFum9XqJ/Ty9Xbnk9YAKwJrf7JDFh+xYOCCnqXZMOzqxwRKvx+E1W ylYO9B6JHMEGkUyIs/1a53r+PPtD8DR0RA/jNvDOSXW6of/ym7XAxKYGYZAXIqhmW7pa OwHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b="lxBhIZ/a"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090a684800b001b9b61aaad9si2148001pjm.91.2022.03.01.03.53.49; Tue, 01 Mar 2022 03:54:04 -0800 (PST) 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; dkim=pass header.i=@canonical.com header.s=20210705 header.b="lxBhIZ/a"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbiCAIub (ORCPT + 99 others); Tue, 1 Mar 2022 03:50:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231127AbiCAIu3 (ORCPT ); Tue, 1 Mar 2022 03:50:29 -0500 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 129D089301 for ; Tue, 1 Mar 2022 00:49:49 -0800 (PST) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id EC8913FCA2 for ; Tue, 1 Mar 2022 08:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646124587; bh=i5oNvJtWT2nQMVMnHuzSOVOeJhkbSN882hqbqowwmW8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lxBhIZ/aP3dTAdK6JB/5dz8jCUrrRDBy3djxrjh9oeQTACwWcXcKPNmz9Kvop1Yzo tf68WzpiVduZqapB/1GfykC834D3IZVYzci+1DFhfuCMEn3yVCBQHL8LOR8Wp+UWYh hTRVNkxQZ3hsPmLAkLOojEPARjg1Txt7V0RMPzZmFjT1ttrt8gv9RV26msszAdpUpr PmczAuNmJseRGvkpZwd9pLdbi6fDUMsAvtVj8rzMrcE3Cr/62VlMRaA92nJJ9poS/T +zttbo/20MspNgxGhHEr2oJYFK7SwfAVQ9MTPoSn+susGCLqcSv0R9vJqaY7X2xsFh rgQAdqi/jF0mQ== Received: by mail-ej1-f71.google.com with SMTP id c23-20020a170906925700b006d6e2797863so1139195ejx.14 for ; Tue, 01 Mar 2022 00:49:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=i5oNvJtWT2nQMVMnHuzSOVOeJhkbSN882hqbqowwmW8=; b=dHR2FXspQfTgC9p1tkcYx1t54bBiKw2XM+Bs/pPxblgsP+JxqXdh23vbM0ijbd3Lqu 6vzu3f38YgyQ9sD+l6CX9EIKdgDnKqBHqIVks48MgekUUjGF1kmYd5bI1+4Ip3MRV/v4 CKtrlJHOMy1gDtQgWTVlqaVMVnFmlgpF65TLgAD42F0TRh0/SNS5aQeTnOQfW0rWImQy sjdULV/cOJ4stWsh9HX4Ivvxy/bPtGRqD9e9nmwR1/dDACPUh1zOKyVU3gtmGau1eQhw WiP2F4dVsh++jB03+djWNlVe1o3p+q3Ji3SRUw7r7eV0Wlm5V1T6vCUUmfQI45Rus9lw G1Bg== X-Gm-Message-State: AOAM531fdnhEL1GCmh3BuYy9Wa8g/DM/zEbdSJpq6sXMtjbqjwxMb3kt UoNfcEhzhexYWrHSAsfK64tMWL+if5hQRZFLiLEmSRjgE+oPOXPSWP8wpOWDjKzYM6SI1yNMMmL /j6LxSbq6A3PQrAJEZvPpwuSh008Xv8Sg6joDhUeEcg== X-Received: by 2002:aa7:db47:0:b0:413:7649:c2bb with SMTP id n7-20020aa7db47000000b004137649c2bbmr18696625edt.123.1646124577529; Tue, 01 Mar 2022 00:49:37 -0800 (PST) X-Received: by 2002:aa7:db47:0:b0:413:7649:c2bb with SMTP id n7-20020aa7db47000000b004137649c2bbmr18696608edt.123.1646124577357; Tue, 01 Mar 2022 00:49:37 -0800 (PST) Received: from [192.168.0.136] (xdsl-188-155-181-108.adslplus.ch. [188.155.181.108]) by smtp.gmail.com with ESMTPSA id y14-20020a50eb8e000000b00410a2e7798dsm6893213edr.38.2022.03.01.00.49.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Mar 2022 00:49:36 -0800 (PST) Message-ID: <40d9b2ad-2f8a-42c8-54cf-b22e24d78538@canonical.com> Date: Tue, 1 Mar 2022 09:49:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 01/11] driver: platform: Add helper for safer setting of driver_override Content-Language: en-US To: Bjorn Helgaas Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Stuart Yoder , Laurentiu Tudor , Abel Vesa , Shawn Guo , Sascha Hauer , Fabio Estevam , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Bjorn Helgaas , Bjorn Andersson , Mathieu Poirier , Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Andy Gross , Srinivas Kandagatla , Mark Brown , "Michael S. Tsirkin" , Jason Wang , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, virtualization@lists.linux-foundation.org, Linus Torvalds , Rasmus Villemoes References: <20220228200326.GA516164@bhelgaas> From: Krzysztof Kozlowski In-Reply-To: <20220228200326.GA516164@bhelgaas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 28/02/2022 21:03, Bjorn Helgaas wrote: > On Sun, Feb 27, 2022 at 02:52:04PM +0100, Krzysztof Kozlowski wrote: >> Several core drivers and buses expect that driver_override is a >> dynamically allocated memory thus later they can kfree() it. > >> +int driver_set_override(struct device *dev, const char **override, >> + const char *s, size_t len) >> +{ >> + const char *new, *old; >> + char *cp; >> + >> + if (!dev || !override || !s) >> + return -EINVAL; >> + >> + /* We need to keep extra room for a newline */ > > It would help a lot to extend this comment with a hint about where the > room for a newline is needed. It was confusing even before, but it's > much more so now that the check is in a completely different file than > the "show" functions that need the space. > Indeed, this needs explanation. Best regards, Krzysztof