Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp155473ybv; Tue, 18 Feb 2020 20:04:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyyP4rxqXNgNmkvbIkKs7c07bGam3Xhl898PsueySgxrnOOY4QxD0oApDwquQu4uN5i+dk2 X-Received: by 2002:a05:6808:249:: with SMTP id m9mr3507093oie.5.1582085069920; Tue, 18 Feb 2020 20:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582085069; cv=none; d=google.com; s=arc-20160816; b=VrbplJisKelQoJ+PGQWMz/3kO4Z3ecRKHTLfebbQqwIXj7fIWsX38rjdpZRssho/0Y NLol0Ix7B2P7M8sPgng5SFdt5SDsnNzHkmY8tE+deSANWXHT03/9vWayQ54I7RJLS069 LVVY8y4lcUpLsWWdqOJWAyy8uIbGutTGme0T7qqh4Vi39Ulg7VAJnkdrNhVPueZA8XFY DX6ExZKPL7cAzuE3Yn50+Oa2l5gXL/VvJ1b/ZRa9At3mED9ladY2A5MZc5RmRlB1UXKZ NP59ofA/LhbVYOlUwgATrGoU3QtwiSh6A5a+MprRjc1Yyb2g1XrLXniMgJ1HthXfcb5C juJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4a082+unim5sSZcSwTAMdgcw2O0kQMVZyf+PWBOP5+Y=; b=AupcJ4jS8lsSbK+jCyQLp6WSiJuI3APvX6zHqkbXvF1/SRobi1m9mr8PANFBg2CQ2n asoYBoBFdqlIAsEuMUgP9ITyzaUC1fDdnF1c434GA2ogzViT7NUCd6aZZLhV05mIpyXF 6S1cDlMPbwxF/kaoISO05mFNiPu35SFD1S0LuCN1euShX1qaD79JztSHYvWwn7LdSAlJ CvAg/nPa0Nil0bWaakP/FqOqmcJDvbRCFleUCZIbPo1cc5QVhNStNOO9owpCzBkqEV2g Ov1pndmG7HDDNedBrn1I0yKzeKAXf7dlfuZ7ieDGvnhBY7rilcU8HqfRkik8L92z7qts N0RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ptZwoVIx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si650333ots.99.2020.02.18.20.04.17; Tue, 18 Feb 2020 20:04:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ptZwoVIx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbgBSEDf (ORCPT + 99 others); Tue, 18 Feb 2020 23:03:35 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:51618 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbgBSEDf (ORCPT ); Tue, 18 Feb 2020 23:03:35 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01J43Dro116100; Wed, 19 Feb 2020 04:03:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=4a082+unim5sSZcSwTAMdgcw2O0kQMVZyf+PWBOP5+Y=; b=ptZwoVIxZwWZK+1uDUkiLEiSYuN7xdBgP2DccB4ZIFHLsQbSYushQ7mdFkhOB3djz5hv FMtNsv7JvbGEp9MC0Vt6ojqdpR3Da9DvbnURgb3+aFHh9Tjm3z39YSfLKh9EM26ycF7w +fu50BAmCNgOV9xzbHPGsw/AczaaagTUKKSdCE2MS31hs9Y3bvFT2GlzOFdsYQ4K7lQy d7RtSiwn44l44MC6QNKlQdHUC+J06bqGfEfnvkgyyEZhE0JisC6WbADmxLxIbGuWZkrs tO0DHDmPQ63JPhXyLP782udUWehrHHlZ+dqrnDpFA4ASBTEvPk53rTxZBAl6fiOtUG/t 5Q== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2y8udd0d6c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Feb 2020 04:03:13 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01J42KAJ075792; Wed, 19 Feb 2020 04:03:12 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2y8ud9njdy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Feb 2020 04:03:12 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01J42tKC019491; Wed, 19 Feb 2020 04:02:55 GMT Received: from kadam (/129.205.23.165) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Feb 2020 20:02:55 -0800 Date: Wed, 19 Feb 2020 07:02:44 +0300 From: Dan Carpenter To: Kaaira Gupta Cc: Nicolas Saenz Julienne , Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: bcm2835-camera: call function instead of macro Message-ID: <20200219040244.GI7838@kadam> References: <20200218160727.GA17010@kaaira-HP-Pavilion-Notebook> <20200218183711.GE19641@kadam> <20200218191747.GA12782@kaaira-HP-Pavilion-Notebook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200218191747.GA12782@kaaira-HP-Pavilion-Notebook> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 suspectscore=9 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002190028 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=9 priorityscore=1501 bulkscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002190028 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 19, 2020 at 12:47:47AM +0530, Kaaira Gupta wrote: > On Tue, Feb 18, 2020 at 09:37:11PM +0300, Dan Carpenter wrote: > > On Tue, Feb 18, 2020 at 09:37:28PM +0530, Kaaira Gupta wrote: > > > Fix checkpatch.pl warning of 'macro argument reuse' in bcm2835-camera.h > > > by removing the macro and calling the function, written in macro in > > > bcm2835-camera.h, directly in bcm2835-camera.c > > > > > > Signed-off-by: Kaaira Gupta > > > --- > > > .../bcm2835-camera/bcm2835-camera.c | 28 +++++++++++++++---- > > > .../bcm2835-camera/bcm2835-camera.h | 10 ------- > > > 2 files changed, 22 insertions(+), 16 deletions(-) > > > > > > diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c > > > index 1ef31a984741..19b3ba80d0e7 100644 > > > --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c > > > +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c > > > @@ -919,9 +919,17 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, > > > else > > > f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; > > > f->fmt.pix.priv = 0; > > > - > > > - v4l2_dump_pix_format(1, bcm2835_v4l2_debug, &dev->v4l2_dev, &f->fmt.pix, > > > - __func__); > > > + v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, > > > + "%s: w %u h %u field %u pfmt 0x%x bpl %u sz_img %u colorspace 0x%x priv %u\n", > > > + __func__, > > > + (&f->fmt.pix)->width, > > > + (&f->fmt.pix)->height, > > > + (&f->fmt.pix)->field, > > > + (&f->fmt.pix)->pixelformat, > > > + (&f->fmt.pix)->bytesperline, > > > + (&f->fmt.pix)->sizeimage, > > > + (&f->fmt.pix)->colorspace, > > > + (&f->fmt.pix)->priv); > > > > This is not as nice to look at as the original. Just ignore the > > warning. > > > > regards, > > dan carpenter > > > So, is this warning to be ignored from everywhere in every driver, as it > doesn't look good? And if yes, then why is it there in the first place? Obviously the reason for the warning is a good idea. Do a google search for the dangers of c macros if you don't understand. But at the same time uniformity and clean code is nice so it's a matter of setting priorities. Checkpatch is just a Perl script and not the King of The World. We can ignore it if we want to. regards, dan carpenter