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 54634C4332F for ; Mon, 14 Nov 2022 15:48:13 +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=X/mR1v46XkFyf/Qz/sETeaIznewgLJIaipoAC8leUgQ=; b=pBa0wOcee5AV12 LUojticytKUcBYsrFzSwzWzlkfsSAD+q2pa4nx+NmfcUu2ClWGfUo6rqWwcvTgqeY9/axw5xiYlQc qEwL6/KqGkWYZRtaZCa25Xm5bbUh5z2y1INtNWnaUlPseVW7iqWGub57jUucf6CfqjXKjIz+3fUap W99L87yJc9P1enwaJwIJuqs49Y0AJIruoYSexCCM22284X3IbQRKbIituBvJ9vzuNxwFFDujWPrbd DFoZ1oQTWLS7Kyjz1q6CH9u/egF39huILp1o3obgKP0z+akQQA3+YZEs/2nk5OYB3U8FBt0fwLuPl QMa/KxFFcHHMTpHn2Cew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oubfW-002QHj-LY; Mon, 14 Nov 2022 15:46:42 +0000 Received: from mga18.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oubfT-002QFR-1l for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 15:46:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668440799; x=1699976799; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VDaLfJvXwECfuRPSE8pK2QFtlBh89ngfYKiiJvz35CA=; b=bSglXwGIjp8rO6ifydQQ3Jd98ZxXz0FXctsyXQ07fdkIBOt2niL6PjVp 6rKH6u2izjAmTHGeKOEfVAiYtIl3t0eYgERPoSZB1v31FV/SETCtPBK7q k53tDPi9lmXVaw9vq0W46Swo1Xc0jIt8dMDMjidHbXVgKEBUqG2OIBqs1 X2v+G4+FCoFqe2WDPGye3eM4P2vf4pxjWf7q6OB43yThlnLuIv43KQzJE j46LBt46fM5Jks/wh4Xjov5cNq3aSWOLqffBeGS6Kg4kGFooZ5LdAUkrs lj5HSawAs+QEupddnUh84MTYsd41l0XsRqjJi3cc9APPBZ5G/CloXE0Zf w==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="295364796" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="295364796" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 07:46:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="632849142" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="632849142" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 14 Nov 2022 07:46:31 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oubfI-00CEVn-2n; Mon, 14 Nov 2022 17:46:28 +0200 Date: Mon, 14 Nov 2022 17:46:28 +0200 From: Andy Shevchenko To: Petr Mladek Cc: Russell King , Linus Walleij , Bartosz Golaszewski , Rob Herring , Lee Jones , Alyssa Rosenzweig , 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: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_074639_157842_4E69070B X-CRM114-Status: GOOD ( 17.20 ) 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:34:07PM +0100, Petr Mladek wrote: > On Tue 2022-11-08 16:33:22, Russell King 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. > > > + break; > > + case 'l': > > + val = orig = le32_to_cpu(orig); > > + break; > > + case 'b': > > + val = orig = be32_to_cpu(orig); > > + break; Isn't easy to fix? Something like below? switch (fmt[2]) { case 'h': break; case 'r': orig = swab32(orig); break; case 'l': orig = le32_to_cpu(orig); break; case 'b': orig = be32_to_cpu(orig); break; ... } val = orig; -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel