Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp145599rdh; Tue, 13 Feb 2024 12:03:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCURqdqu4hCI4e2XkSbG+0WAiAR9v/hIrJyTAkhc50FPPLRRKpR/312ljDdaODFjd3u/CkVdBeqoG7IjDfgW0AWUkIEB0z05hjW2R3uGdQ== X-Google-Smtp-Source: AGHT+IFScIhWF4vhUt7TyE0LSih42YhaZS3XtX/P4hvdwuHcOl9OwxX92YDuCl8QQt+cW530vFug X-Received: by 2002:a17:902:e844:b0:1d9:5563:431 with SMTP id t4-20020a170902e84400b001d955630431mr5711306plg.7.1707854610947; Tue, 13 Feb 2024 12:03:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707854610; cv=pass; d=google.com; s=arc-20160816; b=J7umdktK1XgYrJiFRGvyl/VQP/71MYV9bYvGfdT96SgZrbcZAgqQh8o569ifSXO52j HAlZD4RWLJH7tVE6uGCpffqVytlstjKxw7elRov56Rvfr2SIhV7om3Zk5whxSHBSYa3v yps/OfHgChygO+9sWAF19LDx+LSN9V/nL6wesmW3Vf53INC8rMYliSxExP9n97PpfPEA ao0wIeW5ii9rf/VyhBvu7OW1EEnsV4+JubanSMkdR2YLg44SgFGbdFcfaunU1trVA61x OPLvzuPp7juWwFUvPLPRksE2FXMXxbnrHInO1FNZdffJkXqjJHBCbwOL8QKIvflV5a01 uSeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=EhtpUFkFlthmjyUpDukYfIXXd3DSFRq21rlHuRcpL0E=; fh=5hs3jKfH+684kuDPem+VCJV7U2saczMg9eNwzX1B4L8=; b=LvOF30V1hEnLL+85s3rVSZBODoupEvEFhI7ql03y8JX24jbTZ6VXO6egmC5DO+aYgH IB61LYbF69LyxZOyd/rfkTVwcysPP0ATaV3tsofTKRB3fFZMGvsfrKhfH4QMnss6TE6I hf7snwFPReac2c7hKvxFk2pfChgKuH8fInl1/RJKIWDkvVldom2BLSu3nCzNWhXwEQLJ Uqw6sDcGiM0LLzRB8uRYD/akoTSxP4PQp2IjJLM1KniGSf8tiOLpN7mS/VC+ekIThDtr l6tjOeGKUywiITaI9umZshX/TEQARAvUFYCy5fnMDnSokPvQD74c78TFZb6mN2NV5qS6 4J7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kernel.crashing.org); spf=pass (google.com: domain of linux-kernel+bounces-64187-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64187-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWA7qoO6G5ROha2lb7Ten/bIwdOATO/vlsRbg/ObBIK/Rs+00b00x5qatG5v3j5vp5l3QHrxp0Aqza/SPd77PZmzazSQmqEoP3VO5T1yA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l14-20020a170903244e00b001d919be90f8si2522491pls.132.2024.02.13.12.03.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 12:03:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64187-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kernel.crashing.org); spf=pass (google.com: domain of linux-kernel+bounces-64187-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64187-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D00FCB29F00 for ; Tue, 13 Feb 2024 19:43:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FAD660898; Tue, 13 Feb 2024 19:42:54 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F071E58122; Tue, 13 Feb 2024 19:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.228.1.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707853373; cv=none; b=Lq1vwSrfXcoq4EGznIKnfTvSUIz2xSQ+WRf31C0mctCny3/y4v867V5Uc9v7sfH5+gQuRQdZr+TWsSO6R82Y5UnvvDvIpQHuSPVqwpiuD842opbD4PoHoMh8NfFrQTgCLu2/ZPHDicKCnxCKkFuJBIQB74cMSD32GXsgygXOhRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707853373; c=relaxed/simple; bh=mvl3b+U7XdsMslEuAEGtOkRcbNX+zT482nAV1C+9Aho=; h=Date:From:To:Cc:Subject:Message-ID:References:Mime-Version: Content-Type:Content-Disposition:In-Reply-To; b=bxYeDcZ5MaMyxUFucVf6p/zTW4vlbTmjc1qzpCfunt1hkfgQhdrOFdYXnJXjbW7UwkOGOZebQseTQmnwIAQ2UDl+SVP0PzsKS+feeOEAmm7ePhGIj/FvD4nLh3BIkLcGJLmxsmNeZ1aeCxaZmlMfZt7NE1nUrU6OwG+TSKmFORk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org; spf=pass smtp.mailfrom=kernel.crashing.org; arc=none smtp.client-ip=63.228.1.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 41DJCu2k018865; Tue, 13 Feb 2024 13:12:56 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 41DJCtmj018864; Tue, 13 Feb 2024 13:12:55 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 13 Feb 2024 13:12:54 -0600 From: Segher Boessenkool To: Arnd Bergmann Cc: Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , llvm@lists.linux.dev, Nick Desaulniers , linux-kernel@vger.kernel.org, Nathan Chancellor , Bill Wendling , linux-serial@vger.kernel.org, Justin Stitt , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] tty: hvc-iucv: fix function pointer casts Message-ID: <20240213191254.GA19790@gate.crashing.org> References: <20240213101756.461701-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240213101756.461701-1-arnd@kernel.org> User-Agent: Mutt/1.4.2.3i On Tue, Feb 13, 2024 at 11:17:49AM +0100, Arnd Bergmann wrote: > clang warns about explicitly casting between incompatible function > pointers: > > drivers/tty/hvc/hvc_iucv.c:1100:23: error: cast from 'void (*)(const void *)' to 'void (*)(struct device *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] > 1100 | priv->dev->release = (void (*)(struct device *)) kfree; > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Such a cast of course is explicitly allowed by 6.3.2.3/8, only calling a function using a non-compatible type is UB. This warning message is quite misleading. Doubly so because of the -Werror, as always. Your proposed new code of course is nice and simple (albeit a bit bigger than it was before, both source and binary). Such is life ;-) Segher