Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1381175rwo; Sat, 22 Jul 2023 12:08:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlHfWEpo9z/njeDTVZQxUerAoUDU6Qt5EqI1uKyJAfSQDbZjr5inm4iOP9APHfGIi7fd9mBu X-Received: by 2002:a17:902:bd49:b0:1bb:95f5:2210 with SMTP id b9-20020a170902bd4900b001bb95f52210mr595910plx.24.1690052923847; Sat, 22 Jul 2023 12:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690052923; cv=none; d=google.com; s=arc-20160816; b=xMEy/lq2gtB63sevTKXZDBsGJ5tma2f02NSCkNKeQs9xTplSBVxVvvB2pbHLG4wCpl mj0S1HFa0ZIqrySG+tH6+qz+LoKp0jT1DMtRb2eWUzGuqTcNdo6YdJYjbpGXhr553iJT dwcFLygt5uifMmNTfQrPr8sRgB8XSBwH6JZpUDwDksGoOI+27v8Qv+4qHQhVq1snTZOr n05bk6Ofn3IXXQe2ZuERnVRZ1Q9XezpiGlHfdYY9R/FY8bg4aAVQjTw1moUxm0+1/6d0 IEyACgqLEGuTSnfXBnH67aT0pDcftTwkV9jARdHnOg6wm5sKpk2dywsy6hpif2recVah rN6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=7guB4ZLz29lC5Mz2i2OthYSB2/BMWeO0nASQlIgRzPY=; fh=NOlbIEOXNLXBTpw2+eBKqiuR+qlQaM1p0y/7A6d3arE=; b=AJGkxs8dZae5h+e6p1CwnNXWQChpZe8Zm2s+ZR6xyV4NnI7Ip+g0+zl2M1PSr8SOOs eJdnebc9NKVm5Wwl5fpLzTrfJNSLP79PYd2qP9YgspWm9oTu2GKpNkcF2p8+SN9nIpat i6uSm+x0KZAj4vp4+NjCye+OTfKw5jQTtTVhzs60nqrpKmvXaTVrXPISQwNbUl600kJv BE2XlhVWIV60IwaxkxrrH5iUETLnaeJs5u1AY5LxBpwOV8SrkVVTbUq7qMw6iBN/GEXy eVNSDKeuJJO6k7ECC245TFQaHNMqbWkMAkbm77zckc1i4/wkB8bMSPVDck3SjW1ASJBi s4uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=vTwlnTIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a170902e80700b001b9ea0f0e25si6114380plg.607.2023.07.22.12.08.31; Sat, 22 Jul 2023 12:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=vTwlnTIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbjGVTGd (ORCPT + 99 others); Sat, 22 Jul 2023 15:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjGVTGc (ORCPT ); Sat, 22 Jul 2023 15:06:32 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C015E45; Sat, 22 Jul 2023 12:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690052788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7guB4ZLz29lC5Mz2i2OthYSB2/BMWeO0nASQlIgRzPY=; b=vTwlnTIAozIFBeEey9kTSN7kQfGflFzQIMU6ef7N3eHkTi2pT32bhu4G+CSr/HVijfzw9J ztjvH+lqV4wKa/Obra29W78agD13UuzGwhonM9pdBQvxum7RPDoXbP0vnFywVliagz7V6h zF4lNOGG7a92XX9XY6CG6ph7jYcPFAY= Message-ID: <96ce584d2ba6cb58ab3d5f8ea64f18ada54de944.camel@crapouillou.net> Subject: Re: [PATCH v2 21/22] i2c: virtio: Remove #ifdef guards for PM related functions From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron , Viresh Kumar , Conghui Chen , virtualization@lists.linux-foundation.org Date: Sat, 22 Jul 2023 21:06:26 +0200 In-Reply-To: <20230722115310.27681-5-paul@crapouillou.net> References: <20230722115046.27323-1-paul@crapouillou.net> <20230722115310.27681-5-paul@crapouillou.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the build bot noticed - this patch is invalid as the virtio_driver.{freeze,restore} callbacks are guarded by #ifdefs. Feel free to apply the rest (if everybody is happy with them) and I'll respin this one. Cheers, -Paul Le samedi 22 juillet 2023 =C3=A0 13:53 +0200, Paul Cercueil a =C3=A9crit=C2= =A0: > Use the new PM macros for the suspend and resume functions to be > automatically dropped by the compiler when CONFIG_PM or > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. >=20 > This has the advantage of always compiling these functions in, > independently of any Kconfig option. Thanks to that, bugs and other > regressions are subsequently easier to catch. >=20 > Signed-off-by: Paul Cercueil > Reviewed-by: Jonathan Cameron > Acked-by: Viresh Kumar >=20 > --- > Cc: Conghui Chen > Cc: Viresh Kumar > Cc: virtualization@lists.linux-foundation.org > --- > =C2=A0drivers/i2c/busses/i2c-virtio.c | 8 ++------ > =C2=A01 file changed, 2 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/i2c/busses/i2c-virtio.c > b/drivers/i2c/busses/i2c-virtio.c > index 4b9536f50800..c60ae531ba57 100644 > --- a/drivers/i2c/busses/i2c-virtio.c > +++ b/drivers/i2c/busses/i2c-virtio.c > @@ -243,7 +243,6 @@ static struct virtio_device_id id_table[] =3D { > =C2=A0}; > =C2=A0MODULE_DEVICE_TABLE(virtio, id_table); > =C2=A0 > -#ifdef CONFIG_PM_SLEEP > =C2=A0static int virtio_i2c_freeze(struct virtio_device *vdev) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0virtio_i2c_del_vqs(vdev); > @@ -254,7 +253,6 @@ static int virtio_i2c_restore(struct > virtio_device *vdev) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return virtio_i2c_setup_v= qs(vdev->priv); > =C2=A0} > -#endif > =C2=A0 > =C2=A0static const unsigned int features[] =3D { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0VIRTIO_I2C_F_ZERO_LENGTH_= REQUEST, > @@ -269,10 +267,8 @@ static struct virtio_driver virtio_i2c_driver =3D > { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.driver=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=3D { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0.name=C2=A0=C2=A0=C2=A0=3D "i2c_virtio", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}, > -#ifdef CONFIG_PM_SLEEP > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.freeze =3D virtio_i2c_freeze, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.restore =3D virtio_i2c_restor= e, > -#endif > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.freeze=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=3D pm_sleep_ptr(virtio_i2c_freeze), > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.restore=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =3D pm_sleep_ptr(virtio_i2c_restore), > =C2=A0}; > =C2=A0module_virtio_driver(virtio_i2c_driver); > =C2=A0