Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp171168lqj; Wed, 10 Apr 2024 07:20:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVf9gGoA2Dkpl3Su3qXgOBQsmAwi36hB9NI/u2qGm9aXI5I+sDjB8hWIRgdrlnpuytd1DMhpXTaJTeHDKUqyqBX/U3zRq+Se0RHTbgRuw== X-Google-Smtp-Source: AGHT+IHwFJaLMY88P5cO2XK/Zg980MhGeyWfKtn+hOZdyKH2Xv0u9ZCtZ0mYiM/MYOsaU472dSnE X-Received: by 2002:ac2:54bc:0:b0:515:af97:6776 with SMTP id w28-20020ac254bc000000b00515af976776mr1568426lfk.65.1712758829562; Wed, 10 Apr 2024 07:20:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712758829; cv=pass; d=google.com; s=arc-20160816; b=DNMsB1JPL4p60KFTo6w9fZQqlsQCB+gPPP/8SjBhp97qK7XCCC2CwFsFh+ohcbnJWM NRkQz9Tssj3Mvd15vYCD1aWaII1uAr8K/c8wHcOLygT6IAGS6JA2zivv+kRW3N3gXSHy 8Ud+oes2sckBQxUsJ5ddHRnHgJTHrALJ1DcwPP2le+fHT28MnSxOuYonCkiGT3HXVtl/ dc7luqfVMMQl2mOL6qE8QKfmX+iUqZb58LqPfMsDCgdPQW5eRTl/p+zvnLx4yCuuuv/C ZyCi3anaHtqL0kVXpl5lnXVrhgEezWHGNXzUNyjQ6JPCSG74DEKmbsw/toFtk/Rv1d9T Ez+g== 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=4sqOyShozbfgpfsXkY78/Ca10+RkzI/0o7T0A1SATr0=; fh=+13XqMJWc6pgbjXF6kzSSiiaiq1sMbR2aba/anzR5fU=; b=BKLjYmz404R/Mcj7a32NEChqYbeRWcE+ZCT7K+t+SjHpRIUy/d6yF4KTNloKsxAEXu 24+DkNQ0IRXFzsIFQpLNRJYGgwRgVcDUtP6LWUizFj+NdFBw5K/JtGm2bjDuXGzaE7T0 97NJgUipNbVO7PqqdjSQO5nIF2Q6wzj45S4YQcGrB+sgfJfoJp25wSqUfI7pVU/TRktS sYkrtSdyKzPhtl2N/0ilO5zrCujmPwTnL1v6X/QSDTl8k30mH/2D9Gqqf+74ykI8GzWn yV7yvybFF1uZ4OYU0IAvTLtqWAiYJeopzUbaEH1YhiO9eYyp3qCEGfTUxfhOxkvhgQws gNaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V14ElEy3; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-138737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gn34-20020a1709070d2200b00a51d6db14cesi3221855ejc.401.2024.04.10.07.20.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 07:20:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V14ElEy3; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-138737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138737-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 46FE51F219FD for ; Wed, 10 Apr 2024 14:20:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 790B415EFD8; Wed, 10 Apr 2024 14:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="V14ElEy3" 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 8A51915EFAE; Wed, 10 Apr 2024 14:20:13 +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=1712758813; cv=none; b=pAyMVkTz9gM2Aa6Q2XvLJuMtS7flPqUxy6VQVNAQlWK3LtehYonLY9fYXzNt3f3Ac4HHzocTKqFuLQoAkhCshRv18H2RX7sAYS22UWcuKtb6uUZAYqG5EA0tl4pTKn/Z1CUEG1TQQ1YozfFOKGRupFCFsiEsbbMX+OFW339GItM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712758813; c=relaxed/simple; bh=aeP7or6lM7mKmoKfVa+tvVtPe1gqG6DJYSTUfqq5iCY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fKaEd96erBOSUKVk/osfjOLjh/2O6mJOhuyrsxwk81m+quqXhDsp2p+ocGVlUhBJRuGCMJjmmcFxkwRTI4Utc4Dr/ay+Hvq451fcS1hCcwFs9KhdXID5KskNdH+lSaJreCebu8T8fx13LA0y5788b1PDshnDGCKpFxBbWOrg558= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=V14ElEy3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B867CC433C7; Wed, 10 Apr 2024 14:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712758813; bh=aeP7or6lM7mKmoKfVa+tvVtPe1gqG6DJYSTUfqq5iCY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V14ElEy3imRCM6wPDNr6fG76/Bjb5MyTwpjhStw/BupEwW+jkAvbrGYllvVPF7jV8 wq3sRO1Eqg8bqsFQ7Bv1kBP0ijgZ14Z8Yuq+4Fsu+41G67xeVc0HZcRtCWwnQCs0ux 5JLlSyTxvIa8EN8Xn9s4XdScI3Xlg5k0s9sjY2pk= Date: Wed, 10 Apr 2024 16:20:10 +0200 From: Greg Kroah-Hartman To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Jiri Slaby Subject: Re: [PATCH v1 1/1] serial: max3100: Convert to_max3100_port() to be static inline Message-ID: <2024041057-angles-flatware-b7ba@gregkh> References: <20240410141135.1378948-1-andriy.shevchenko@linux.intel.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: <20240410141135.1378948-1-andriy.shevchenko@linux.intel.com> On Wed, Apr 10, 2024 at 05:11:35PM +0300, Andy Shevchenko wrote: > As Jiri rightfully pointed out the current to_max3100_port() macro > implementation is fragile in a sense that it expects the variable > name to be port, otherwise it blow up the build. > > Change this to be static inline to prevent bad compilation. Is there a problem today? If not, this line isn't needed, as it sounds like you are fixing a problem here, when all you are doing is making it "nicer", right? > Suggested-by: Jiri Slaby > Signed-off-by: Andy Shevchenko > --- > drivers/tty/serial/max3100.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c > index 1e6b5763ce3f..07ee001640bb 100644 > --- a/drivers/tty/serial/max3100.c > +++ b/drivers/tty/serial/max3100.c > @@ -111,7 +111,10 @@ struct max3100_port { > struct timer_list timer; > }; > > -#define to_max3100_port(port) container_of(port, struct max3100_port, port) > +static inline struct max3100_port *to_max3100_port(struct uart_port *port) > +{ > + return container_of(port, struct max3100_port, port); Note, the one reason you might want to do this as a #define is if you use container_of_const() which has to be a #define. So the fact that this was a define to start with is normal and not really a big deal. thanks, greg k-h