From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbbFVFdz (ORCPT ); Mon, 22 Jun 2015 01:33:55 -0400 Received: from ni.piap.pl ([195.187.100.4]:34014 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbbFVFdp (ORCPT ); Mon, 22 Jun 2015 01:33:45 -0400 From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: Joe Perches Cc: Frans Klaver , Andy Whitcroft , lkml Subject: Re: Coding style details (checkpatch) References: <1434725667.2689.121.camel@perches.com> Date: Mon, 22 Jun 2015 07:33:42 +0200 In-Reply-To: <1434725667.2689.121.camel@perches.com> (Joe Perches's message of "Fri, 19 Jun 2015 07:54:27 -0700") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 79655 [Jun 22 2015] X-KLMS-AntiSpam-Version: 5.5.6 X-KLMS-AntiSpam-Envelope-From: khalasa@piap.pl X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Moebius-Timestamps: 3611648, 3611665, 3611558 X-KLMS-AntiSpam-Info: LuaCore: 230 2015-06-18_15-19-46 a57002d05d325a1ca642728c4b1d1e7603231830, Auth:dkim=none X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2015/06/18 15:23:24 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2015/06/22 01:06:00 #8271670 X-KLMS-AntiVirus-Status: Clean, skipped Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joe Perches writes: > How is the macro used? > #define REG8_1(a0) ((const u16[8]){a0, a0 + 1, a0 + 2, a0 + 3}) #define REG8_1(a0) ((const u16[8]){a0, a0 + 1, a0 + 2, a0 + 3, a0 + 4, a0 + 5, a0 + 6, a0 + 7}) #define REG8_2(a0) ((const u16[8]){a0, a0 + 2, a0 + 4, a0 + 6, a0 + 8, a0 + 0xA, a0 + 0xC, a0 + 0xE}) #define REG8_8(a0) ((const u16[8]){a0, a0 + 8, a0 + 0x10, a0 + 0x18, a0 + 0x20, a0 + 0x28, a0 + 0x30, a0 + 0x38}) #define VDMA_CHANNEL_CONFIG REG8_1(0x10) #define ADMA_P_ADDR REG8_2(0x18) #define ADMA_B_ADDR REG8_2(0x19) #define INTL_HBAR_CTRL REG8_1(0x30) #define VIDEO_FIELD_CTRL REG8_1(0x39) #define HSCALER_CTRL REG8_1(0x42) #define VIDEO_SIZE REG8_1(0x4A) #define VIDEO_SIZE_F2 REG8_1(0x52) #define MD_CONF REG8_1(0x60) #define MD_INIT REG8_1(0x68) #define MD_MAP0 REG8_1(0x70) #define VDMA_P_ADDR REG8_8(0x80) /* not used in DMA SG mode */ #define VDMA_WHP REG8_8(0x81) #define VDMA_B_ADDR REG8_8(0x82) #define VDMA_F2_P_ADDR REG8_8(0x84) #define VDMA_F2_WHP REG8_8(0x85) #define VDMA_F2_B_ADDR REG8_8(0x86) then reg_write(vc->dev, VDMA_CHANNEL_CONFIG[vc->ch], dma_cfg); reg_write(dev, SAT_U[ch], ctrl->val); reg_write(dev, SAT_V[ch], ctrl->val); etc. -- Krzysztof Halasa Industrial Research Institute for Automation and Measurements PIAP Al. Jerozolimskie 202, 02-486 Warsaw, Poland -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/