Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp684957pxa; Sat, 1 Aug 2020 02:55:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypO133aEI8Hs8Sm68aygLFV6Dfi8Khl06nVCWqberblquekt4a7EllJFkOWxLNEhIlcFJH X-Received: by 2002:a05:6402:3070:: with SMTP id bs16mr4694699edb.269.1596275706552; Sat, 01 Aug 2020 02:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596275706; cv=none; d=google.com; s=arc-20160816; b=sm8MFdqt538ZnmC9Fw9BvwMQAniP6c8MCY8mthQeE4K1EuQpnxlZwf+GevEI4TcLCt +g/q/3QbaUCobjmg2AXtAr2JZiSdS3RVyBPUH1vXoXxZknezS9P5Z2Hkcpx20EExFl3B SJ7F+b3tUbmdpFsyiNekftJjvLKRiuTN39cFVIL2lyktRuBU/5j5XU2DVZCP0YHomOir 4361PKqMOPQlvU1ai0tJj58QVdmH0HOxg+Uc59uttc8qEwzY0F81/EcqWlxqEdUGQotV SMZslAzIKLQeynm+FEZhMfmoaqbzHx6M6pdA6pq25WhSU1NMJ/NHjvA+7IhMNvPy+7hs Fflw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tf9YrvqunjWSXE58CP1LeIQaxTWx4DrW0PhPfa7Ob98=; b=wDJofw9DDmJPx2fO1vP6WK2UZn5qy+zPtl6xycaiTueYniBkWKHOFLXSsVJiwq0iod KQRFKcMFww5ldtJdAwAfuv5V6OJ7lQ1C9i2wgSEYleVB7SMC0L6VLvo4BGIRA9EWl0fN /QB3CZGnXDzt8NXcZ3N5C61BDkaX+tMF+yLXOpUGHiRtj0x+i3ubVHiiBuqON020SPvP 0/sLURZy86RWRE+KX1+URw5F8PA9SRnbX4gS+dCCTPIuSm1FGxVjsItzOcN3yMzrUE4r i7UfnKKIwBa49PB4582E3BQ4Kzq5E6qHQtLnJByJtLOei8YP8rPMZBlIL0JwUCHxzNHo GE2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnyoXCl5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si6806953ejc.7.2020.08.01.02.54.41; Sat, 01 Aug 2020 02:55:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnyoXCl5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726888AbgHAJvY (ORCPT + 99 others); Sat, 1 Aug 2020 05:51:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:41586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgHAJvY (ORCPT ); Sat, 1 Aug 2020 05:51:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15ABB20725; Sat, 1 Aug 2020 09:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596275483; bh=v2/+wm7/ZgJPVdDZ5fDV3AVWi0VZF9wUEj4ulC1C+2g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bnyoXCl5yo3Qywrx47QApLP9qsK4JomrJFDjiHlDxLf0G3jbLWDKLA2NHeyaDRBwU B9ANzpmijpStrTK3/juzfa4R7PgOaO//4gxJat2Ts5sP/D6G62eyNm72fbC1v8grkB YcY4vTtmiV3txsSGstN/BdKzjssF6jPp7m8J/PmE= Date: Sat, 1 Aug 2020 11:51:08 +0200 From: Greg Kroah-Hartman To: Ivan Safonov Cc: Larry Finger , devel@driverdev.osuosl.org, B K Karthik , linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: r8188eu: replace rtw_netdev_priv define with inline function Message-ID: <20200801095108.GA2840539@kroah.com> References: <20200801094707.13449-1-insafonov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200801094707.13449-1-insafonov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 01, 2020 at 12:47:07PM +0300, Ivan Safonov wrote: > The function guarantees type checking of arguments and return value. > > Signed-off-by: Ivan Safonov > --- > drivers/staging/rtl8188eu/include/osdep_service.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h > index 31d897f1d21f..e0ccafdea9cd 100644 > --- a/drivers/staging/rtl8188eu/include/osdep_service.h > +++ b/drivers/staging/rtl8188eu/include/osdep_service.h > @@ -71,8 +71,10 @@ struct rtw_netdev_priv_indicator { > }; > struct net_device *rtw_alloc_etherdev_with_old_priv(void *old_priv); > > -#define rtw_netdev_priv(netdev) \ > - (((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv) > +static inline struct adapter *rtw_netdev_priv(struct net_device *dev) > +{ > + return (((struct rtw_netdev_priv_indicator *)netdev_priv(dev))->priv); > +} > void rtw_free_netdev(struct net_device *netdev); Is the cast really needed? And no blank line before the next function prototype? And is this really needed? Type checking is already happening as this is a "simple" macro, right? thanks, greg k-h