Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: Fix style issues in radeon _encoders.c & _gart.c

Conform to Linux kernel coding style.

Fixes the following & other checks in radeon_encoders.c & radeon_gart.c:

WARNING: Missing a blank line after declarations
WARNING: Block comments use * on subsequent lines
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: braces {} are not necessary for single statement blocks

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Srinivasan Shanmugam and committed by
Alex Deucher
8eb94c9b 93125cb7

+30 -29
+13 -9
drivers/gpu/drm/radeon/radeon_encoders.c
··· 58 58 count = -1; 59 59 list_for_each_entry(clone_encoder, &dev->mode_config.encoder_list, head) { 60 60 struct radeon_encoder *radeon_clone = to_radeon_encoder(clone_encoder); 61 + 61 62 count++; 62 63 63 64 if (clone_encoder == encoder) ··· 109 108 if (ASIC_IS_AVIVO(rdev)) 110 109 ret = ENCODER_INTERNAL_KLDSCP_DAC2_ENUM_ID1; 111 110 else { 112 - /*if (rdev->family == CHIP_R200) 113 - ret = ENCODER_INTERNAL_DVO1_ENUM_ID1; 114 - else*/ 111 + /* if (rdev->family == CHIP_R200) 112 + * ret = ENCODER_INTERNAL_DVO1_ENUM_ID1; 113 + * else 114 + */ 115 115 ret = ENCODER_INTERNAL_DAC2_ENUM_ID1; 116 116 } 117 117 break; ··· 236 234 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 237 235 if (connector->encoder == encoder) { 238 236 struct radeon_connector *radeon_connector = to_radeon_connector(connector); 237 + 239 238 radeon_encoder->active_device = radeon_encoder->devices & radeon_connector->devices; 240 239 DRM_DEBUG_KMS("setting active device to %08x from %08x %08x for encoder %d\n", 241 240 radeon_encoder->active_device, radeon_encoder->devices, ··· 323 320 struct drm_device *dev = encoder->dev; 324 321 struct radeon_device *rdev = dev->dev_private; 325 322 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; 326 - unsigned hblank = native_mode->htotal - native_mode->hdisplay; 327 - unsigned vblank = native_mode->vtotal - native_mode->vdisplay; 328 - unsigned hover = native_mode->hsync_start - native_mode->hdisplay; 329 - unsigned vover = native_mode->vsync_start - native_mode->vdisplay; 330 - unsigned hsync_width = native_mode->hsync_end - native_mode->hsync_start; 331 - unsigned vsync_width = native_mode->vsync_end - native_mode->vsync_start; 323 + unsigned int hblank = native_mode->htotal - native_mode->hdisplay; 324 + unsigned int vblank = native_mode->vtotal - native_mode->vdisplay; 325 + unsigned int hover = native_mode->hsync_start - native_mode->hdisplay; 326 + unsigned int vover = native_mode->vsync_start - native_mode->vdisplay; 327 + unsigned int hsync_width = native_mode->hsync_end - native_mode->hsync_start; 328 + unsigned int vsync_width = native_mode->vsync_end - native_mode->vsync_start; 332 329 333 330 adjusted_mode->clock = native_mode->clock; 334 331 adjusted_mode->flags = native_mode->flags; ··· 427 424 bool radeon_encoder_is_digital(struct drm_encoder *encoder) 428 425 { 429 426 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 427 + 430 428 switch (radeon_encoder->encoder_id) { 431 429 case ENCODER_OBJECT_ID_INTERNAL_LVDS: 432 430 case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
+17 -20
drivers/gpu/drm/radeon/radeon_gart.c
··· 74 74 75 75 ptr = dma_alloc_coherent(&rdev->pdev->dev, rdev->gart.table_size, 76 76 &rdev->gart.table_addr, GFP_KERNEL); 77 - if (ptr == NULL) { 77 + if (!ptr) 78 78 return -ENOMEM; 79 - } 79 + 80 80 #ifdef CONFIG_X86 81 81 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 || 82 82 rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) { ··· 99 99 */ 100 100 void radeon_gart_table_ram_free(struct radeon_device *rdev) 101 101 { 102 - if (rdev->gart.ptr == NULL) { 102 + if (!rdev->gart.ptr) 103 103 return; 104 - } 104 + 105 105 #ifdef CONFIG_X86 106 106 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 || 107 107 rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) { ··· 133 133 r = radeon_bo_create(rdev, rdev->gart.table_size, 134 134 PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, 135 135 0, NULL, NULL, &rdev->gart.robj); 136 - if (r) { 136 + if (r) 137 137 return r; 138 - } 139 138 } 140 139 return 0; 141 140 } ··· 196 197 { 197 198 int r; 198 199 199 - if (rdev->gart.robj == NULL) { 200 + if (!rdev->gart.robj) 200 201 return; 201 - } 202 + 202 203 r = radeon_bo_reserve(rdev->gart.robj, false); 203 204 if (likely(r == 0)) { 204 205 radeon_bo_kunmap(rdev->gart.robj); ··· 219 220 */ 220 221 void radeon_gart_table_vram_free(struct radeon_device *rdev) 221 222 { 222 - if (rdev->gart.robj == NULL) { 223 + if (!rdev->gart.robj) 223 224 return; 224 - } 225 + 225 226 radeon_bo_unref(&rdev->gart.robj); 226 227 } 227 228 ··· 238 239 * Unbinds the requested pages from the gart page table and 239 240 * replaces them with the dummy page (all asics). 240 241 */ 241 - void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, 242 + void radeon_gart_unbind(struct radeon_device *rdev, unsigned int offset, 242 243 int pages) 243 244 { 244 - unsigned t; 245 - unsigned p; 245 + unsigned int t, p; 246 246 int i, j; 247 247 248 248 if (!rdev->gart.ready) { ··· 282 284 * (all asics). 283 285 * Returns 0 for success, -EINVAL for failure. 284 286 */ 285 - int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, 287 + int radeon_gart_bind(struct radeon_device *rdev, unsigned int offset, 286 288 int pages, struct page **pagelist, dma_addr_t *dma_addr, 287 289 uint32_t flags) 288 290 { 289 - unsigned t; 290 - unsigned p; 291 + unsigned int t, p; 291 292 uint64_t page_base, page_entry; 292 293 int i, j; 293 294 ··· 304 307 for (j = 0; j < (PAGE_SIZE / RADEON_GPU_PAGE_SIZE); j++, t++) { 305 308 page_entry = radeon_gart_get_page_entry(page_base, flags); 306 309 rdev->gart.pages_entry[t] = page_entry; 307 - if (rdev->gart.ptr) { 310 + if (rdev->gart.ptr) 308 311 radeon_gart_set_page(rdev, t, page_entry); 309 - } 312 + 310 313 page_base += RADEON_GPU_PAGE_SIZE; 311 314 } 312 315 } ··· 329 332 { 330 333 int r, i; 331 334 332 - if (rdev->gart.pages) { 335 + if (rdev->gart.pages) 333 336 return 0; 334 - } 337 + 335 338 /* We need PAGE_SIZE >= RADEON_GPU_PAGE_SIZE */ 336 339 if (PAGE_SIZE < RADEON_GPU_PAGE_SIZE) { 337 340 DRM_ERROR("Page size is smaller than GPU page size!\n");