Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753952AbbGUIgg (ORCPT ); Tue, 21 Jul 2015 04:36:36 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36016 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753928AbbGUIgT (ORCPT ); Tue, 21 Jul 2015 04:36:19 -0400 Date: Tue, 21 Jul 2015 11:35:41 +0300 From: Dan Carpenter To: Vinay Simha BN Cc: "open list:STAGING SUBSYSTEM" , "open list:STAGING - SILICON MOTION SM750 FRAME BUFFER DRIVER" , Teddy Wang , Greg Kroah-Hartman , open list , Sudip Mukherjee Subject: Re: [PATCH 1/2] sm750fb: coding style fixes lines over 80 chars Message-ID: <20150721083541.GK5371@mwanda> References: <1437461084-17565-1-git-send-email-simhavcs@gmail.com> <1437464402-18451-1-git-send-email-simhavcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437464402-18451-1-git-send-email-simhavcs@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2203 Lines: 47 On Tue, Jul 21, 2015 at 01:10:00PM +0530, Vinay Simha BN wrote: > diff --git a/drivers/staging/sm750fb/sm750_help.h b/drivers/staging/sm750fb/sm750_help.h > index 8dc6bd2..43d700b 100644 > --- a/drivers/staging/sm750fb/sm750_help.h > +++ b/drivers/staging/sm750fb/sm750_help.h > @@ -49,17 +49,23 @@ > /* Field Macros */ > #define FIELD_START(field) (0 ? field) > #define FIELD_END(field) (1 ? field) > -#define FIELD_SIZE(field) (1 + FIELD_END(field) - FIELD_START(field)) > -#define FIELD_MASK(field) (((1 << (FIELD_SIZE(field)-1)) | ((1 << (FIELD_SIZE(field)-1)) - 1)) << FIELD_START(field)) > -#define FIELD_NORMALIZE(reg, field) (((reg) & FIELD_MASK(field)) >> FIELD_START(field)) > -#define FIELD_DENORMALIZE(field, value) (((value) << FIELD_START(field)) & FIELD_MASK(field)) > +#define FIELD_SIZE(field) (1 + FIELD_END(field) - \ > + FIELD_START(field)) > +#define FIELD_MASK(field) (((1 << (FIELD_SIZE(field)-1)) \ > + | ((1 << (FIELD_SIZE(field)-1)) - 1)) \ > + << FIELD_START(field)) > +#define FIELD_NORMALIZE(reg, field) (((reg) & FIELD_MASK(field)) >> \ > + FIELD_START(field)) > +#define FIELD_DENORMALIZE(field, value) (((value) << FIELD_START(field)) & \ > + FIELD_MASK(field)) > > #define FIELD_INIT(reg, field, value) FIELD_DENORMALIZE(reg ## _ ## field, \ > - reg ## _ ## field ## _ ## value) > + reg ## _ ## field ## _ ## value) > #define FIELD_INIT_VAL(reg, field, value) \ > (FIELD_DENORMALIZE(reg ## _ ## field, value)) > #define FIELD_VAL_SET(x, r, f, v) x = x & ~FIELD_MASK(r ## _ ## f) \ > - | FIELD_DENORMALIZE(r ## _ ## f, r ## _ ## f ## _ ## v) > + | FIELD_DENORMALIZE(r ## _ ## f, \ > + r ## _ ## f ## _ ## v) > > #define RGB(r, g, b) \ > ( \ These are worse for reading now. Better to ignore the warning instead of making the code ugly. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/