Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp476974rdh; Wed, 14 Feb 2024 02:37:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXdIzPUWlBaOcOv1YpsyCPbP+I3uijMH2Pn5VGcAYaaKnVa2ThQhjOyR8RZ+PSZjOm9xnrn1N1ca0A2ubT9gsmbE1bfa4Np+p8G4Gqnxw== X-Google-Smtp-Source: AGHT+IHEnauSqyQOJnIjKGmXQqBWVuwd8+ETuiHQlCmhs0aq2X1OMjFrK6r3lqtSO0dfH731+CEU X-Received: by 2002:a05:6a00:4f02:b0:6dd:a32f:d383 with SMTP id lb2-20020a056a004f0200b006dda32fd383mr1826448pfb.29.1707907054378; Wed, 14 Feb 2024 02:37:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707907054; cv=pass; d=google.com; s=arc-20160816; b=n9dQFV8DnA+4I/fJ5hHAajNb3y6lp7NMjg3k8yJwlIkYgJbKwQL/RrWlEIvhKoXSkL QnvT7oUgG2teh0CNBex+DZKNJCjeZDlZjtfuK0MvOfG3J/ogkaz6KtY1/gXZXS13qPe7 N9+GWQJXn+aKibgE56/7iri+VabTY+13yyQp/FM91OXirRVKW6LG/5V/ZF2DcALtGbWW cL1MzfnyJBHsSiNHdfiqaRczN6+3H5VIemRknRvAIVyryrDTDi8t9Mp25pxo6RndroXD fdqV8mVQDIvKtU/EB8eZKrFhjP8nTJ3Vcb38a00nsH/lrPaKDuJwQj5DNKiz26jO/9hk z3kg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vUUHs1nq4pGvG0FgcxM/8ROcugJGQQniB7jwkAQ+zhw=; fh=g4ZVoLFyA1lX5o8hw9Scsm4XviX/mNGskTL6areyWrc=; b=jWVsC9b17U8KIRdKfRtoInlk5KeqprffIH+f4nSWO61nrmR+ZkTq8ZO3NVQlMEW+vc 3WbE8QJqYMYGI0GBGPnnZEkagyG5Of+Yfy64qcaO8ixu+3NdL1XIAXd9/oLkbM7RF4Y0 5+WM2K68ku/DOpXhR3ltXYejMgAF7qzWQybBORxiCDThI2l/ZoZkDLUdP+e1r+ldRTSn z8EFjOxBtVTTRyl2Q0NTxCf+JlFGGnQhf8XLp4subDUW6AmV0vKD9c1NRAhO19isPMi1 cKYCVJMM+ewDY6Tp80DyTKCBRd0OqFcgCn7ZFPrbOYnVc2EjA+mFozgCxopCVi5C1t6D w9EQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yAdiU5Zg; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-65058-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65058-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org X-Forwarded-Encrypted: i=2; AJvYcCVhq//Owe0nk0s0YRNejEptSTkoVDjNU0+kJk/YEPaJqw9/QhGgqIC2Hm7bfbKoJLAWr9XzNhC3C/+XI5lLJKS1xXfGC7ZacqMgbERtEA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bo23-20020a056a02039700b005dbec91be93si3713445pgb.595.2024.02.14.02.37.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 02:37:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65058-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yAdiU5Zg; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-65058-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65058-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E1CD9283D69 for ; Wed, 14 Feb 2024 10:37:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A94418021; Wed, 14 Feb 2024 10:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yAdiU5Zg" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CA0E125BB; Wed, 14 Feb 2024 10:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707907047; cv=none; b=bTRo9GTU+RLjkYHba3euREYkI96DixXRqYP3STquxBq5FdKJ9ftgF1V32g5NhsZHvfnEj0Fmc9GSHc23D1tbd2MhiDzaw27RoZnLycAadVOPrrP+rQWTxn5MWs8y1iDCKzZovVgMErIJPrZYDRrKg8V3RlrdtQgYQi10nAcvNVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707907047; c=relaxed/simple; bh=cxED5YPWgHhSBwJHo1owowGzFn88/peBM/syHypcwGY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ns2VxVzMelhJnu2YVdiIs1c+0y+EJpqcEEtHJ7E+DuuYUy0jCOIJjVsswlweCwxDzp7qbSMXkS7+H8y/TQB6RQYLx+hPmMi6TxEYoN/jf3yxtG+yzaUwIOu/XwvA3pFH+/COt0qJKkvFyozH3EE2TcEI2DEj+YU7DnyD2BpYAVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yAdiU5Zg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C309C433F1; Wed, 14 Feb 2024 10:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1707907047; bh=cxED5YPWgHhSBwJHo1owowGzFn88/peBM/syHypcwGY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yAdiU5ZgI53hqY9FwXIbYtEU1neJBgYWFVbQJYJQwKXuydESuXEAkxtgQ1Doj7u+i cWtV6GEl8rnlmooZ4HfX5YgYMbwAoMxyqATdC1vH4siqe7TubRvZGjMd0jFL5pEv2P BM0MlKnjrrgvHqS9R/ysZy5aq4ai9YmWWeaP6ePU= Date: Wed, 14 Feb 2024 11:37:21 +0100 From: Greg Kroah-Hartman To: David Laight Cc: 'Segher Boessenkool' , Arnd Bergmann , "linuxppc-dev@lists.ozlabs.org" , Arnd Bergmann , "llvm@lists.linux.dev" , Nick Desaulniers , "linux-kernel@vger.kernel.org" , Nathan Chancellor , Bill Wendling , "linux-serial@vger.kernel.org" , Justin Stitt , Jiri Slaby Subject: Re: [PATCH] tty: hvc-iucv: fix function pointer casts Message-ID: <2024021426-unleveled-unhearing-8021@gregkh> References: <20240213101756.461701-1-arnd@kernel.org> <20240213191254.GA19790@gate.crashing.org> <57d72e2ccc8245fe99982613a11c461c@AcuMS.aculab.com> 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: <57d72e2ccc8245fe99982613a11c461c@AcuMS.aculab.com> On Wed, Feb 14, 2024 at 09:46:33AM +0000, David Laight wrote: > From: Segher Boessenkool > > Sent: 13 February 2024 19:13 > > > > 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. > > But it will get called using the wrong type. > And (is it) fine-ibt will reject the incorrect call. And rightfully so, this type of casting abuse is just that, abuse. Almost no one should be just calling kfree() on a device pointer, I'll look at the surrounding code as odds are something odd is going on. But for now, this patch is correct. thanks, greg k-h