Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp706016lqe; Sat, 6 Apr 2024 23:13:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlSMAO3pFGVb07g8pS143zD22qYLQrNf2q2srM3vu8ZCXEJIYZ0PO+LDd0R5PpHn6coDe9tqO/qBExqrGW4PhkHxe23skLxoFc8TDflA== X-Google-Smtp-Source: AGHT+IHa40cG1uB/Bk9P/i6F1nrIzkCm4iMsX7jZA30k8Y5rj6iXEkxXReicmblPrbu0o+QVUDY7 X-Received: by 2002:ac8:5a53:0:b0:434:6f5f:cf4b with SMTP id o19-20020ac85a53000000b004346f5fcf4bmr4086829qta.55.1712470410020; Sat, 06 Apr 2024 23:13:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712470410; cv=pass; d=google.com; s=arc-20160816; b=dMEkX9MDimQksIcQ4PnM8hAGCuSKv1EvW7FLfIQvr4/J9bYP2z9LHsDdWvBehn68ou 7SNQlK3M83sbNLlpcStvz0X5/xq+NrjS3WFEdAdWJ4oyRsuNV3MFW2OraAUi1Q9IRvr8 Gnm6HKydUH8RIYJTkYxfhMQV99AfKYpmxBeGTH8a8TZVwgUZZYEeebiiwLkjPAeyYOLH dw4bGTGW1Y1iWUmyaJp1tQsFhtCttG+QIdHNZeYHgAbE6dzXrQH0dhyYw8nL7IHd3o+j 4Bj+Kbfjkqfjc5CbVyBU7Fs9w7yMcyPXB2eq870wGcvAyomUKSbF+g4pGJcPyP6hu6Dd G46g== 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=0uCBCAJNzHfwrXgmWRcBnSgW/ztNjeb2kA1RpYjk32s=; fh=FGdGPKNl4WqghQCjVpzmwwsC8aOIr7kgUSb+WShxfF8=; b=uyOtaMbFymU6riJnWsndci/S+xvrrffteLytGLGFXXf9smRz71SeZunR6ZG6TAoiYH 9vwawbk5eurOLuZ+/TIToitV9kyD1gr1U5WuCySNY9yt+r00wnr3nBKG5zukneOmlrvU U/VtZuO28TK1EVjqQGr7OdPIEcRObc/8B6ifZJSwmVZZWmBv4aK8l8s5yPRyhcO5oHPU CQpWzuBxgNnMLykVuAKW/DW3XZrTjO7JQV11SulOfFkWckawV0XvHvd5C0dzF1tcWuI9 KrGmN9IFyZ8lAxjiHTFsBx5cjwi8Wc8pkK9IV09eWLLGyr8dlX6fBhRzHOhydfLcSgsR /0PA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZEHQ9yVQ; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-134189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n3-20020ac85a03000000b004348ab3d4f0si486561qta.448.2024.04.06.23.13.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 23:13:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZEHQ9yVQ; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-134189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134189-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A3A7D1C22587 for ; Sun, 7 Apr 2024 06:13:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D5A06AB9; Sun, 7 Apr 2024 06:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZEHQ9yVQ" 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 1E790184D; Sun, 7 Apr 2024 06:13:23 +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=1712470404; cv=none; b=E/e8Du2t1wTQobFq+TY35ZrcZVcpBvkWMk2OByP8jdpvMh04CjvS82aLNknfWrg2bYrV9bn8iBtVYfcBZ4vdW/spuvTYHFlh6UlFkzWRhjwNdbrMPeN6jIaV1o27BHYMEfmsp76K0Urq0kfsJ21ztYdzsqq9dyzy6aoT7xDnrqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712470404; c=relaxed/simple; bh=4wcLIJ61+MYcFNncPI6IcB5hQwoIi8wRWHK0RjMxaog=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=B2lE4/hbc4Tes0VVrBBOYI8NFXRCxczNb+VevOAKr3ya7iZGlW5fWAR95/yeJz4MnNdycxMJP7PmcilU11mv6OAKuQNwhFr3fntJe5IaOyZglwjW7x9BMWZ3KqXv+9OFEzpRspnmUMIsrS3382CBqUynosB35Q1q5o0e+pAu704= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZEHQ9yVQ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE2F2C433C7; Sun, 7 Apr 2024 06:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712470403; bh=4wcLIJ61+MYcFNncPI6IcB5hQwoIi8wRWHK0RjMxaog=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZEHQ9yVQtK1MSybStYHVzVrR94EHrGftYkrZf0sx+cnPVNg4J5MFIMaYU5Yc1092R 8+ElU4E7SknAZPdszFo0iXxICwLpgh8l/pLmHYT2lnz+s5x695j31L/JDmacM5Sbj/ va2S2xOXsq+sNbDrUQ5p72jLGIBRYkraWXSTlpNI= Date: Sun, 7 Apr 2024 08:13:19 +0200 From: Greg Kroah-Hartman To: Jackson Chui Cc: Johan Hovold , Alex Elder , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: greybus: Clear up precedence for gcam logging macros Message-ID: <2024040708-dividing-igloo-37ed@gregkh> References: <20240404001627.94858-1-jacksonchui.qwerty@gmail.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: <20240404001627.94858-1-jacksonchui.qwerty@gmail.com> On Wed, Apr 03, 2024 at 05:16:28PM -0700, Jackson Chui wrote: > Reported by checkpatch: > > CHECK: Macro argument 'gcam' may be better as '(gcam)' to avoid > precedence issues > > Disambiguates '&' (address-of) operator and '->' operator precedence, > accounting for how '(gcam)->bundle->dev' is a 'struct device' and not a > 'struct device*', which is required by the dev_{dbg,info,err} driver > model diagnostic macros. Issue found by checkpatch. This really is not an issue at all, as you are dealing with pointers and structures and nothing else. > > Signed-off-by: Jackson Chui > --- > drivers/staging/greybus/camera.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c > index a8173aa3a995..d82a2d2abdca 100644 > --- a/drivers/staging/greybus/camera.c > +++ b/drivers/staging/greybus/camera.c > @@ -180,9 +180,9 @@ static const struct gb_camera_fmt_info *gb_camera_get_format_info(u16 gb_fmt) > > #define GB_CAMERA_MAX_SETTINGS_SIZE 8192 > > -#define gcam_dbg(gcam, format...) dev_dbg(&gcam->bundle->dev, format) > -#define gcam_info(gcam, format...) dev_info(&gcam->bundle->dev, format) > -#define gcam_err(gcam, format...) dev_err(&gcam->bundle->dev, format) > +#define gcam_dbg(gcam, format...) dev_dbg(&((gcam)->bundle->dev), format) Again, the original code here is fine. Getting rid of the gcam_*() functions would be nice, as hiding dev_*() calls isn't really needed. thanks, greg k-h