From patchwork Sat Jun 6 11:58:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 6559351 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 738A4C0020 for ; Sat, 6 Jun 2015 11:59:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF4AA2066A for ; Sat, 6 Jun 2015 11:59:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3FDE20693 for ; Sat, 6 Jun 2015 11:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbbFFL7T (ORCPT ); Sat, 6 Jun 2015 07:59:19 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:50462 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600AbbFFL7J (ORCPT ); Sat, 6 Jun 2015 07:59:09 -0400 Received: from dyn3-82-128-190-185.psoas.suomi.net ([82.128.190.185] helo=localhost.localdomain.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z1Ckl-0006LH-RS; Sat, 06 Jun 2015 14:59:07 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: David Howells , Antti Palosaari Subject: [PATCH 5/8] ts2020: Add a comment about lifetime of on-stack pdata in ts2020_attach() Date: Sat, 6 Jun 2015 14:58:45 +0300 Message-Id: <1433591928-30915-5-git-send-email-crope@iki.fi> X-Mailer: git-send-email 2.4.2 In-Reply-To: <1433591928-30915-1-git-send-email-crope@iki.fi> References: <1433591928-30915-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.190.185 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: David Howells ts2020_attach() allocates a variable pdata on the stack and then passes a pointer to it to i2c_new_device() which stashes the pointer in persistent structures. Add a comment to the effect that this isn't actually an error because the contents of the variable are only used in ts2020_probe() and this is only called ts2020_attach()'s stack frame exists. Signed-off-by: David Howells Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/ts2020.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c index 797112b..f674717 100644 --- a/drivers/media/dvb-frontends/ts2020.c +++ b/drivers/media/dvb-frontends/ts2020.c @@ -363,6 +363,8 @@ struct dvb_frontend *ts2020_attach(struct dvb_frontend *fe, { struct i2c_client *client; struct i2c_board_info board_info; + + /* This is only used by ts2020_probe() so can be on the stack */ struct ts2020_config pdata; memcpy(&pdata, config, sizeof(pdata));