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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86BB3EB64DC for ; Sat, 24 Jun 2023 19:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbjFXTDP (ORCPT ); Sat, 24 Jun 2023 15:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbjFXTDO (ORCPT ); Sat, 24 Jun 2023 15:03:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6461010A for ; Sat, 24 Jun 2023 12:03:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EED2D600E1 for ; Sat, 24 Jun 2023 19:03:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3E4DC433C9; Sat, 24 Jun 2023 19:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687633392; bh=3yLec4OQwczkQ/kmMrEsOXE+LLwxkwLipHrOBu3vMcs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h1VwXEPMtzIaKC1DBEtpFHOmVTY3XKNb7US8u/G0+zLGjiSNjtX511ofFvhnIodi1 8bAGG8hqKh4NrHmvmmHhO8uUdcisafeUnEQdBwxv3d/jk/x/sGk3UQ975TBGyre3n6 ch0VFTumScrumDlLc0X+o/Vr8tzYfGkjqh/unyG4MWAkxQ2TXj/TzGt/mVIdDEo6/k OWfkmUIstx+cO7cFKg3AQc14CU8+MuW9oz90+STD8bEIckW/ROi33uAe/WR+rOyB8y loTwl+zbOYoqghwNw0pDJIDAYZDqwS23dh0XbbIX3YW178eXwEOJKVifpmPfeV41X8 0blEmwhiuA5tw== Date: Sat, 24 Jun 2023 21:03:08 +0200 From: Simon Horman To: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Cc: daire.mcnamara@microchip.com, conor.dooley@microchip.com, lpieralisi@kernel.org, robh@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v1 2/8] PCI: microchip: Remove cast warning for devm_add_action_or_reset() arg Message-ID: References: <20230614155556.4095526-1-daire.mcnamara@microchip.com> <20230614155556.4095526-3-daire.mcnamara@microchip.com> <20230624183428.GF2636347@rocinante> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230624183428.GF2636347@rocinante> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Sun, Jun 25, 2023 at 03:34:28AM +0900, Krzysztof WilczyƄski wrote: > [+CC Simon] > > Hello, > > > The kernel test robot reported that the ugly cast from > > void(*)(struct clk *) to void (*)(void *) converts to incompatible > > function type. This commit adopts the common convention of creating a > > trivial stub function that takes a void * and passes it to the > > underlying function that expects the more specific type. > > This is a nice change, but it seems it has been carried along a few other > series and through their different revisions. Simon also found the problem > and addressed it independently per: > > https://lore.kernel.org/linux-pci/20230511-pci-microchip-clk-cast-v1-1-7674f4d4e218@kernel.org > > However, we have a few other drivers where we could take care of this, per: > > drivers/pci/controller/pcie-microchip-host.c > 864- return ERR_PTR(ret); > 865- > 866: devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare, > 867- clk); > 868- > > drivers/pci/controller/dwc/pcie-keembay.c > 170- > 171- ret = devm_add_action_or_reset(dev, > 172: (void(*)(void *))clk_disable_unprepare, > 173- clk); > 174- if (ret) > > drivers/pci/controller/dwc/pci-meson.c > 189- > 190- devm_add_action_or_reset(dev, > 191: (void (*) (void *))clk_disable_unprepare, > 192- clk); > 193- > > If neither you nor Simon has objections, I can send a small series to > address these in a single take. You could then drop this particular patch > from v2 of this series, should you send a second revision at some point. Hi Krzysztof, Sure, that is fine my me. My 2c worth, is that it would be nice to have a common helper for these cases. But I don't feel strongly about it. 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41A99EB64DC for ; Sat, 24 Jun 2023 19:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s6dpP9PN/sHXhpCbzVxR3CJMNSexsOMHMguWymoX6GQ=; b=Otjl18if0Xn1if BFxflL16hhb18Ko4iRXParpmN0BNlr+WbPP9TZkNOCePHrCCc5LafwpGjyGoGvE1nKXdKPuPoljYR Opu5PHMZ58Ijvu8g6BTBxdUE2a2m45ueZpfBj3TWURS4zj9K+XkAnU6905UWSELekC62xrM3E29SK TODy5NO1hTzSa9/kj8z1HF0M8I2bG9vT3SQOTeuhrxLk5ReUrrClcco50fHNHVlGgiIu1SRiAg7mh 7pO7yOVtS/175TPkXhvAbBPctR2ktGnL4BHzVJKiCH91rZHgaNRoKC2jMhryK/QvXlHQmDG2CPIbF CJkHUqUZkvLsSU0RUd4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qD8XV-006RGB-1v; Sat, 24 Jun 2023 19:03:17 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qD8XT-006RFf-0u for linux-riscv@lists.infradead.org; Sat, 24 Jun 2023 19:03:16 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E2BB16097A; Sat, 24 Jun 2023 19:03:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3E4DC433C9; Sat, 24 Jun 2023 19:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687633392; bh=3yLec4OQwczkQ/kmMrEsOXE+LLwxkwLipHrOBu3vMcs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h1VwXEPMtzIaKC1DBEtpFHOmVTY3XKNb7US8u/G0+zLGjiSNjtX511ofFvhnIodi1 8bAGG8hqKh4NrHmvmmHhO8uUdcisafeUnEQdBwxv3d/jk/x/sGk3UQ975TBGyre3n6 ch0VFTumScrumDlLc0X+o/Vr8tzYfGkjqh/unyG4MWAkxQ2TXj/TzGt/mVIdDEo6/k OWfkmUIstx+cO7cFKg3AQc14CU8+MuW9oz90+STD8bEIckW/ROi33uAe/WR+rOyB8y loTwl+zbOYoqghwNw0pDJIDAYZDqwS23dh0XbbIX3YW178eXwEOJKVifpmPfeV41X8 0blEmwhiuA5tw== Date: Sat, 24 Jun 2023 21:03:08 +0200 From: Simon Horman To: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Cc: daire.mcnamara@microchip.com, conor.dooley@microchip.com, lpieralisi@kernel.org, robh@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v1 2/8] PCI: microchip: Remove cast warning for devm_add_action_or_reset() arg Message-ID: References: <20230614155556.4095526-1-daire.mcnamara@microchip.com> <20230614155556.4095526-3-daire.mcnamara@microchip.com> <20230624183428.GF2636347@rocinante> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230624183428.GF2636347@rocinante> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230624_120315_374871_76453341 X-CRM114-Status: GOOD ( 16.67 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org T24gU3VuLCBKdW4gMjUsIDIwMjMgYXQgMDM6MzQ6MjhBTSArMDkwMCwgS3J6eXN6dG9mIFdpbGN6 ecWEc2tpIHdyb3RlOgo+IFsrQ0MgU2ltb25dCj4gCj4gSGVsbG8sCj4gCj4gPiBUaGUga2VybmVs IHRlc3Qgcm9ib3QgcmVwb3J0ZWQgdGhhdCB0aGUgdWdseSBjYXN0IGZyb20KPiA+IHZvaWQoKiko c3RydWN0IGNsayAqKSB0byB2b2lkICgqKSh2b2lkICopIGNvbnZlcnRzIHRvIGluY29tcGF0aWJs ZQo+ID4gZnVuY3Rpb24gdHlwZS4gIFRoaXMgY29tbWl0IGFkb3B0cyB0aGUgY29tbW9uIGNvbnZl bnRpb24gb2YgY3JlYXRpbmcgYQo+ID4gdHJpdmlhbCBzdHViIGZ1bmN0aW9uIHRoYXQgdGF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