From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5574458065184287721==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings Date: Tue, 01 Sep 2020 17:46:02 +0800 Message-ID: <20200901094602.GA28982@e18970f1e570> In-Reply-To: <202009011711.D4mNHDQW%lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============5574458065184287721== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org TO: Denis Efremov CC: Julia Lawall CC: "Lars-Peter Clausen" CC: Michael Hennerich CC: Jonathan Cameron CC: Hartmut Knaack CC: "Peter Meerwald-Stadler" CC: linux-iio(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/iio/adc/adi-axi-adc.c:279:60-61: WARNING opportunity for kobj_to_de= v() Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci Fixes: a2fc3718bc22 ("coccinelle: api: add kobj_to_dev.cocci script") CC: Denis Efremov Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git f= or-5.10 head: ea3047aac79bc12dfda32fd676d6d1b2a6e5475d commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/4] coccinelle: api: add= kobj_to_dev.cocci script :::::: branch date: 3 days ago :::::: commit date: 11 days ago Please take the patch only if it's a positive warning. Thanks! adi-axi-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/adi-axi-adc.c +++ b/drivers/iio/adc/adi-axi-adc.c @@ -276,7 +276,7 @@ static struct attribute *adi_axi_adc_att static umode_t axi_adc_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev =3D container_of(kobj, struct device, kobj); + struct device *dev =3D kobj_to_dev(kobj); struct iio_dev *indio_dev =3D dev_to_iio_dev(dev); struct adi_axi_adc_state *st =3D iio_priv(indio_dev); struct adi_axi_adc_conv *conv =3D &st->client->conv; --===============5574458065184287721==--