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 55E34C4332F for ; Mon, 14 Nov 2022 16:48:30 +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=Klt7k2ch6DmN6wacDwUppCbfKdSEOVgEG3s2fWTXcVc=; b=UUXhVh3KrQW24s Dwr3rU/dFyhzyzkolfIHvjjpVGQefSEId3VK/BJ3F9sbW/QxydPSRpJFOEcmjuH23XM5EP18zE6Un kcWfwjQO7xyIID35EXiMgunQ3E4NwxzbWSm6RbwuSa3L84S8ySU6tm2DHoY1QHr4jhUmEqupJAw4i SBYYXQDh0LqrbCwAaNHWsOUdFf+ADYS4HQQ6T3pio8cjZ80wH97RSgigoeRRBTwxtniucsJDoZDFT jpae5Ga172jD2bzuP8QkEdCYMtIPXS2zHliU8d0TbcyU+zr+dPL/lBHGGeRV2K7Wd6fb9jCKBYJ9m jMMC50mhCIi4kE3cBNMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oucbp-002pkq-KK; Mon, 14 Nov 2022 16:46:57 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oucbm-002piS-OQ for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 16:46:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=alWvsDEk2ast4MquuTzMfCnex7hE3JeGIqS6LusDl0c=; b=OvNCoOdy4QPkxzrWrzlQEsdgNV IOkyFWL5tNj9hbIYkCtlE5b+1M5vHpQW/8Ov2fi7vXAOpcqdarNLBWSvWvKdvDIr/QX4q73+jRcIf 8GIUJwV/R+bSYqFAaOlWqrvjnj6tY//rU8nxSkHoHXnaoCWyL9POP77DQwHeCoSuDETFVLKAYZwYm xoKYaFRlopJfoWF/aL9NazAcP0/ds20rr8+jRpROGOakFpt1ez+BwMuZlTPWvM0lLXokZOmJZvCNG Cp/OlsLmdWNEUZ7MgLpqmClu3fnd5wC5Ny1J0i6ZiZNcLAfkiBtC3JHd9i2v8I/kiZ6H0naNZaxCw qxoLBaqQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35266) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oucbY-000169-1k; Mon, 14 Nov 2022 16:46:40 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oucbU-0003xd-Jm; Mon, 14 Nov 2022 16:46:36 +0000 Date: Mon, 14 Nov 2022 16:46:36 +0000 From: "Russell King (Oracle)" To: Petr Mladek Cc: Linus Walleij , Bartosz Golaszewski , Rob Herring , Lee Jones , Alyssa Rosenzweig , Andy Shevchenko , asahi@lists.linux.dev, devicetree@vger.kernel.org, Hector Martin , Jonathan Corbet , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-gpio@vger.kernel.org, Rasmus Villemoes , Sergey Senozhatsky , Steven Rostedt , Sven Peter Subject: Re: [PATCH v3 2/7] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc Message-ID: References: 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-20221114_084654_812336_92CD56FD X-CRM114-Status: GOOD ( 17.93 ) 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 Mon, Nov 14, 2022 at 04:15:50PM +0000, Russell King (Oracle) wrote: > On Mon, Nov 14, 2022 at 04:34:07PM +0100, Petr Mladek wrote: > > > orig = get_unaligned(fourcc); > > > - val = orig & ~BIT(31); > > > + switch (fmt[2]) { > > > + case 'h': > > > + val = orig; > > > + break; > > > + case 'r': > > > + val = orig = swab32(orig); > > > > I do not like much these multi assignments. I think that the result > > was not even defined in some older C standards. Though, I can't find > > it now. And even make W=3 does not warn about it. > > Err. > > It's been supported for decades. I learnt about it back in 1992 when > I was introduced to C by another experienced C programmer. It's been > supported in ANSI C compilers. The Norcroft C compiler (which is > strict ANSI) on Acorn platforms back in the late 1980s/1990s even > supported it. > > I think you're a bit out of date. Oh, and it's not like there isn't precedent for doing this in lib/vsprintf.c: 841a915d20c7 vsprintf: Do not have bprintf dereference pointers + len = copy = strlen(args); If you grep lib/, there's many more examples. So, what is in Hectors patch is in no way any different from lots of other examples already merged into the kernel code. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel