From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8CF9CC25B47 for ; Wed, 25 Oct 2023 09:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FKFIiEb8dCZSxQBz9QurQIb3boR1EeuvAqUwMhpCufg=; b=BKgrfZ25hIH/jr nUdSbts1CDvKgMfZtRzoRns8vxkwbsI6YGAETFYuUF9zLZp35mjPIGTPMTtG0FZYfZ51uOUjAL/Qe VP+sMYHestD2Wv8LCBJas3M/7H7k2KU1xcY8/zzMR0calLIMSYV1nQDWST5WcCGrtIKeYLB5xuzYN x3MyoFjIcjNCpy1ck8jeVEhxCXlmAF4ahgq6yMW+qncXpBDVkONQuW4+yBa9LEX6rNly8V5mrU8X8 TIvF6dEYfyIw2kWa5NU+gkeJ/W+7soksg1XtsZK/9BywQoQxbLgHvWZ43BzNqQBGDtuqekX/xZBxA tMSR6KrBbew+J5Gcis5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvaSl-00Bs2s-18; Wed, 25 Oct 2023 09:46:07 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvaSi-00Bs2P-0X; Wed, 25 Oct 2023 09:46:05 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 691926178B; Wed, 25 Oct 2023 09:46:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88251C433C8; Wed, 25 Oct 2023 09:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698227163; bh=zXmP2B8zYPqXpdAmO8tizBj+J/IG8kpzFJNWBcUYlio=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kFzbeKvvyjHPBbNnTe6hPNrK7cXc3E6waaC3JNh+UepTsZQAe/Tviw8Y+coa1e2Wg ZWpiTrDIO4Dm1IYISQ7wfUVm4kPJXS0YYcC4MjABiHi/l9AjwyxgFpKE9M0MVtPDrS n1LAcsJBRXlhdmYd1XkkwdghvbJeoINVJ4s9ZiQg= Date: Wed, 25 Oct 2023 11:46:00 +0200 From: Greg Kroah-Hartman To: Umang Jain Cc: Sakari Ailus , Dan Carpenter , linux-staging@lists.linux.dev, "Ricardo B . Marliere" , linux-rpi-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren , Dan Carpenter , Kieran Bingham , Laurent Pinchart Subject: Re: [PATCH 1/1] staging: vc04_services: Use %p4cc format modifier to print FourCC codes Message-ID: <2023102546-trident-clear-1299@gregkh> References: <20231025060717.71895-1-umang.jain@ideasonboard.com> <20231025060717.71895-2-umang.jain@ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231025_024604_295061_1102D006 X-CRM114-Status: GOOD ( 22.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 25, 2023 at 03:04:04PM +0530, Umang Jain wrote: > > > On 10/25/23 2:58 PM, Sakari Ailus wrote: > > On Wed, Oct 25, 2023 at 10:10:08AM +0300, Dan Carpenter wrote: > > > On Wed, Oct 25, 2023 at 02:07:17AM -0400, Umang Jain wrote: > > > > Drop VCHIQ_FOURCC_AS_4CHARS macro in favour of %p4cc format > > > > modifier to print FourCC codes in the logs. > > > > > > > > vchiq_use_internal() and vchiq_release_internal() uses entity > > > > character-array to store a transient string that contains > > > > a FourCC code. Increase the length of entity array(to 64 bytes) > > > > since %p4cc requires more bytes to hold the output characters. > > > > > > > > Suggested-by: Kieran Bingham > > > > Signed-off-by: Umang Jain > > > > --- > > > > .../interface/vchiq_arm/vchiq_arm.c | 20 +++++----- > > > > .../interface/vchiq_arm/vchiq_core.c | 40 +++++++++---------- > > > > .../interface/vchiq_arm/vchiq_core.h | 6 --- > > > > .../interface/vchiq_arm/vchiq_dev.c | 7 ++-- > > > > 4 files changed, 33 insertions(+), 40 deletions(-) > > > > > > > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > > > index fc6d33ec5e95..de6a24304a4d 100644 > > > > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > > > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > > > @@ -1441,7 +1441,7 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, > > > > { > > > > struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state); > > > > int ret = 0; > > > > - char entity[16]; > > > > + char entity[64]; > > > > int *entity_uc; > > > > int local_uc; > > > > @@ -1454,8 +1454,8 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, > > > > sprintf(entity, "VCHIQ: "); > > > > entity_uc = &arm_state->peer_use_count; > > > > } else if (service) { > > > > - sprintf(entity, "%c%c%c%c:%03d", > > > > - VCHIQ_FOURCC_AS_4CHARS(service->base.fourcc), > > > > + sprintf(entity, "%p4cc:%03d", > > > Not related to your patch but these sprintfs() make me very > > > uncomfortable. > > > > > > KTODO: change sprintf() to snprintf() in staging/vc04_services/ > > Umang: how about one patch on top of this? :-) There are just five > > instances of it. > > Ricardo, how about this? Do you want to take a swing at this ? :-) > > And send a v2. ? No, that would be a separate change, this one is fine as-is. thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel