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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7046C433EF for ; Sat, 29 Jan 2022 16:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352711AbiA2QgI (ORCPT ); Sat, 29 Jan 2022 11:36:08 -0500 Received: from mga18.intel.com ([134.134.136.126]:28556 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbiA2QgH (ORCPT ); Sat, 29 Jan 2022 11:36:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643474167; x=1675010167; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=NeN+U8iKMJdDOcMiYQHwhsKC4blyvRV8SKBOfqOcU+4=; b=g3UMNyPMjRQLa4CRSF4wM9kWg+HLuSxbX6gqbcKRbDwwME7YpMxpQh6F zjZDBt13tVbt6uxuTE2Mc5KOQwQDpqTfSX1MZ+ivaPIYf+jYi5e74vYiL FMx5oLE8Vkgw/qjMrI4ZwPVxl8eVImhNXvGRH0s+nOaGQRer+i+9kQbTD LWQbCV2yFAcpkM3OAqDdxfGH+saQj/46ppG1Fgl/SqvkpFrmJ+QGW05AK cOgnqjzm/tY/fxGbrQQGUcvU2Ed7Rof16SZSH4dwXI6V1iNe9QgaYXdUm UALg8wOA2xtMdDQdzNBf+KJw5vNr9TWmw3G4ReEAacG6AjBTRvKnpwui0 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10242"; a="230856813" X-IronPort-AV: E=Sophos;i="5.88,327,1635231600"; d="scan'208";a="230856813" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2022 08:36:07 -0800 X-IronPort-AV: E=Sophos;i="5.88,327,1635231600"; d="scan'208";a="496431763" Received: from smile.fi.intel.com ([10.237.72.61]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2022 08:36:04 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nDqgm-00FxsL-CB; Sat, 29 Jan 2022 18:35:00 +0200 Date: Sat, 29 Jan 2022 18:35:00 +0200 From: Andy Shevchenko To: Moses Christopher Bollavarapu Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Laurent Pinchart , Tomi Valkeinen , Tsuchiya Yuto Subject: Re: [PATCH] staging: media: atomisp: Use BIT macro instead of left shifting Message-ID: References: <20220129113821.324180-1-mosescb.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220129113821.324180-1-mosescb.dev@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Sat, Jan 29, 2022 at 12:38:04PM +0100, Moses Christopher Bollavarapu wrote: It's a bit too many people in Cc list (I dropped more than a half in this reply). I would suggest to use my script [1] or look into it for a hint how to reduce it. [1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh > There is a BIT(nr) macro available in Linux Kernel, > which does the same thing. In some cases it might fix a (theoretical) UB issue. > Example: BIT(7) = (1UL << 7) ... > + s_config->source.tpg.x_mask = BIT(4) - 1; > + s_config->source.tpg.y_mask = BIT(4) - 1; > + s_config->source.tpg.xy_mask = BIT(8) - 1; For masks you may use GENMASK(). ... > - irq = irq & 1 << INTR_IIR; > + irq = irq & BIT(INTR_IIR); It may be: irq &= BIT(...); ... > - irq = irq & 1 << INTR_IIR; > + irq = irq & BIT(INTR_IIR); Ditto. ... > - virt += (1 << PAGE_SHIFT); > + virt += BIT(PAGE_SHIFT); This is weird. Shouldn't be as simple as virt += PAGE_SIZE; ? ... > enum ia_css_sp_sleep_mode { > SP_DISABLE_SLEEP_MODE = 0, > - SP_SLEEP_AFTER_FRAME = 1 << 0, > - SP_SLEEP_AFTER_IRQ = 1 << 1 > + SP_SLEEP_AFTER_FRAME = BIT(0), > + SP_SLEEP_AFTER_IRQ = BIT(1) While at it, add a comma here. > }; ... > + IA_CSS_DEBUG_DUMP_ALL = BIT(14) /** Dump all device parameters */ Ditto. ... On top of this don't forget to add #include to the modified header files. -- With Best Regards, Andy Shevchenko