From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81ECCC433DB for ; Fri, 19 Mar 2021 16:09:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3491561980 for ; Fri, 19 Mar 2021 16:09:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbhCSQI5 (ORCPT ); Fri, 19 Mar 2021 12:08:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbhCSQIt (ORCPT ); Fri, 19 Mar 2021 12:08:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43893C06174A for ; Fri, 19 Mar 2021 09:08:49 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lNHg7-0000is-Nd; Fri, 19 Mar 2021 17:08:47 +0100 Subject: Re: [PATCH v2 2/2] driver core: add helper for deferred probe reason setting To: Andy Shevchenko Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Sascha Hauer , Linux Kernel Mailing List References: <20210319110459.19966-1-a.fatoum@pengutronix.de> <20210319110459.19966-2-a.fatoum@pengutronix.de> From: Ahmad Fatoum Message-ID: <84861de0-a672-03de-3dc2-c14605a1fff2@pengutronix.de> Date: Fri, 19 Mar 2021 17:08:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andy, On 19.03.21 13:16, Andy Shevchenko wrote: > On Fri, Mar 19, 2021 at 1:46 PM Ahmad Fatoum wrote: >> On 19.03.21 12:13, Andy Shevchenko wrote: >>> On Fri, Mar 19, 2021 at 1:05 PM Ahmad Fatoum wrote: >>>> >>>> We now have three places within the same file doing the same operation >>>> of freeing this pointer and setting it anew. A helper make this >>> >>> makes >>> >>>> arguably easier to read, so add one. >>> >>> FWIW, >>> Reviewed-by: Andy Shevchenko >> >> Thanks will add for v3. >> >>> Now I'm wondering why deferred_probe_reason is not defined with const. >>> >>> Can you check and maybe squeeze a patch in the middle (before these >>> two of this series) to move to const? >> >> The deferred_probe_reason is only used in this file and it either holds >> NULL or a pointer to a dynamically allocated string. I don't see a reason >> why the member should be const. > > But we want to be reliant on the contents of the string, right? > I would put this why it shouldn't be const. > > As far as I understand the strictness here is for good. I don't understand. Mind sending a patch that I can squash? Cheers, Ahmad > > -- > With Best Regards, > Andy Shevchenko > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |