Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2 Eliminate -Wpointer-arith patches; use...



details:   https://anonhg.NetBSD.org/src/rev/9d03e3b12dbf
branches:  trunk
changeset: 744835:9d03e3b12dbf
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Feb 14 04:30:04 2020 +0000

description:
Eliminate -Wpointer-arith patches; use -Wno-pointer-arith instead.

diffstat:

 sys/external/bsd/drm2/amdgpu/files.amdgpu                                                     |   3 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c                                       |  10 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios.c                                   |  52 +++++-----
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_encoders.c                          |  10 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bo_list.c                                    |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c                                     |  14 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_dpm.c                                     |  14 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c                                     |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v10_0.c                                  |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v11_0.c                                  |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v8_0.c                                   |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dpm.c                                        |  52 +++++-----
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c                                      |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v7_0.c                                   |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v8_0.c                                   |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_kv_dpm.c                                     |  14 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_test.c                                       |  22 ++--
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ucode.c                                      |   6 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd.c                                        |   8 +-
 sys/external/bsd/drm2/dist/drm/drm_bufs.c                                                     |   6 +-
 sys/external/bsd/drm2/dist/drm/drm_crtc.c                                                     |  12 +-
 sys/external/bsd/drm2/dist/drm/drm_dp_helper.c                                                |   6 +-
 sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c                                         |   6 +-
 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c                                                |   6 +-
 sys/external/bsd/drm2/dist/drm/i915/i915_guc_submission.c                                     |  16 +-
 sys/external/bsd/drm2/dist/drm/i915/intel_bios.c                                              |  10 +-
 sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c                                          |  14 +-
 sys/external/bsd/drm2/dist/drm/i915/intel_psr.c                                               |   6 +-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/nouveau_nvkm_subdev_bios_shadowpci.c  |   7 +-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c |   8 +-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c |   6 +-
 sys/external/bsd/drm2/dist/drm/radeon/drm_buffer.c                                            |   8 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_test.c                                           |  22 ++--
 sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd.c                                            |  12 +-
 sys/external/bsd/drm2/drm/files.drmkms                                                        |   5 +-
 sys/external/bsd/drm2/i915drm/files.i915drmkms                                                |   3 +-
 sys/external/bsd/drm2/nouveau/files.nouveau                                                   |   5 +-
 sys/external/bsd/drm2/radeon/files.radeon                                                     |   3 +-
 38 files changed, 211 insertions(+), 203 deletions(-)

diffs (truncated from 1693 to 300 lines):

diff -r 656b00dd2ded -r 9d03e3b12dbf sys/external/bsd/drm2/amdgpu/files.amdgpu
--- a/sys/external/bsd/drm2/amdgpu/files.amdgpu Fri Feb 14 04:29:42 2020 +0000
+++ b/sys/external/bsd/drm2/amdgpu/files.amdgpu Fri Feb 14 04:30:04 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.amdgpu,v 1.7 2018/08/27 16:06:01 riastradh Exp $
+#      $NetBSD: files.amdgpu,v 1.8 2020/02/14 04:30:04 riastradh Exp $
 
 version        20180827
 
@@ -19,6 +19,7 @@
 
 makeoptions    amdgpu  "CWARNFLAGS.amdgpu"+="-Wno-missing-field-initializers"
 makeoptions    amdgpu  "CWARNFLAGS.amdgpu"+="-Wno-shadow"
+makeoptions    amdgpu  "CWARNFLAGS.amdgpu"+="-Wno-pointer-arith"
 
 # Local additions.
 file   external/bsd/drm2/amdgpu/amdgpu_module.c        amdgpu
diff -r 656b00dd2ded -r 9d03e3b12dbf sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c   Fri Feb 14 04:29:42 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c   Fri Feb 14 04:30:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_atom.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $        */
+/*     $NetBSD: amdgpu_atom.c,v 1.2 2020/02/14 04:30:04 riastradh Exp $        */
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_atom.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_atom.c,v 1.2 2020/02/14 04:30:04 riastradh Exp $");
 
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -1404,7 +1404,7 @@
 {
        int offset = index * 2 + 4;
        int idx = CU16(ctx->data_table + offset);
-       u16 *mdt = (u16 *)((char *)ctx->bios + ctx->data_table + 4);
+       u16 *mdt = (u16 *)(ctx->bios + ctx->data_table + 4);
 
        if (!mdt[index])
                return false;
@@ -1424,7 +1424,7 @@
 {
        int offset = index * 2 + 4;
        int idx = CU16(ctx->cmd_table + offset);
-       u16 *mct = (u16 *)((char *)ctx->bios + ctx->cmd_table + 4);
+       u16 *mct = (u16 *)(ctx->bios + ctx->cmd_table + 4);
 
        if (!mct[index])
                return false;
@@ -1444,7 +1444,7 @@
        struct _ATOM_VRAM_USAGE_BY_FIRMWARE *firmware_usage;
 
        if (amdgpu_atom_parse_data_header(ctx, index, NULL, NULL, NULL, &data_offset)) {
-               firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)((char *)ctx->bios + data_offset);
+               firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset);
 
                DRM_DEBUG("atom firmware requested %08x %dkb\n",
                          le32_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware),
diff -r 656b00dd2ded -r 9d03e3b12dbf sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios.c       Fri Feb 14 04:29:42 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios.c       Fri Feb 14 04:30:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_atombios.c,v 1.3 2018/08/27 14:04:50 riastradh Exp $    */
+/*     $NetBSD: amdgpu_atombios.c,v 1.4 2020/02/14 04:30:04 riastradh Exp $    */
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *          Alex Deucher
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_atombios.c,v 1.3 2018/08/27 14:04:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_atombios.c,v 1.4 2020/02/14 04:30:04 riastradh Exp $");
 
 #include <asm/byteorder.h>
 #include <drm/drmP.h>
@@ -105,7 +105,7 @@
        i2c.valid = false;
 
        if (amdgpu_atom_parse_data_header(ctx, index, &size, NULL, NULL, &data_offset)) {
-               i2c_info = (struct _ATOM_GPIO_I2C_INFO *)((char *)ctx->bios + data_offset);
+               i2c_info = (struct _ATOM_GPIO_I2C_INFO *)(ctx->bios + data_offset);
 
                num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
                        sizeof(ATOM_GPIO_I2C_ASSIGMENT);
@@ -139,7 +139,7 @@
        char stmp[32];
 
        if (amdgpu_atom_parse_data_header(ctx, index, &size, NULL, NULL, &data_offset)) {
-               i2c_info = (struct _ATOM_GPIO_I2C_INFO *)((char *)ctx->bios + data_offset);
+               i2c_info = (struct _ATOM_GPIO_I2C_INFO *)(ctx->bios + data_offset);
 
                num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
                        sizeof(ATOM_GPIO_I2C_ASSIGMENT);
@@ -176,7 +176,7 @@
        gpio.valid = false;
 
        if (amdgpu_atom_parse_data_header(ctx, index, &size, NULL, NULL, &data_offset)) {
-               gpio_info = (struct _ATOM_GPIO_PIN_LUT *)((char *)ctx->bios + data_offset);
+               gpio_info = (struct _ATOM_GPIO_PIN_LUT *)(ctx->bios + data_offset);
 
                num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
                        sizeof(ATOM_GPIO_PIN_ASSIGNMENT);
@@ -301,18 +301,18 @@
        if (crev < 2)
                return false;
 
-       obj_header = (ATOM_OBJECT_HEADER *) ((char *)ctx->bios + data_offset);
+       obj_header = (ATOM_OBJECT_HEADER *) (ctx->bios + data_offset);
        path_obj = (ATOM_DISPLAY_OBJECT_PATH_TABLE *)
-           ((char *)ctx->bios + data_offset +
+           (ctx->bios + data_offset +
             le16_to_cpu(obj_header->usDisplayPathTableOffset));
        con_obj = (ATOM_CONNECTOR_OBJECT_TABLE *)
-           ((char *)ctx->bios + data_offset +
+           (ctx->bios + data_offset +
             le16_to_cpu(obj_header->usConnectorObjectTableOffset));
        enc_obj = (ATOM_ENCODER_OBJECT_TABLE *)
-           ((char *)ctx->bios + data_offset +
+           (ctx->bios + data_offset +
             le16_to_cpu(obj_header->usEncoderObjectTableOffset));
        router_obj = (ATOM_OBJECT_TABLE *)
-               ((char *)ctx->bios + data_offset +
+               (ctx->bios + data_offset +
                 le16_to_cpu(obj_header->usRouterObjectTableOffset));
        device_support = le16_to_cpu(obj_header->usDeviceSupport);
 
@@ -377,7 +377,7 @@
                                                u16 encoder_obj = le16_to_cpu(enc_obj->asObjects[k].usObjectID);
                                                if (le16_to_cpu(path->usGraphicObjIds[j]) == encoder_obj) {
                                                        ATOM_COMMON_RECORD_HEADER *record = (ATOM_COMMON_RECORD_HEADER *)
-                                                               ((char *)ctx->bios + data_offset +
+                                                               (ctx->bios + data_offset +
                                                                 le16_to_cpu(enc_obj->asObjects[k].usRecordOffset));
                                                        ATOM_ENCODER_CAP_RECORD *cap_record;
                                                        u16 caps = 0;
@@ -405,7 +405,7 @@
                                                u16 router_obj_id = le16_to_cpu(router_obj->asObjects[k].usObjectID);
                                                if (le16_to_cpu(path->usGraphicObjIds[j]) == router_obj_id) {
                                                        ATOM_COMMON_RECORD_HEADER *record = (ATOM_COMMON_RECORD_HEADER *)
-                                                               ((char *)ctx->bios + data_offset +
+                                                               (ctx->bios + data_offset +
                                                                 le16_to_cpu(router_obj->asObjects[k].usRecordOffset));
                                                        ATOM_I2C_RECORD *i2c_record;
                                                        ATOM_I2C_ID_CONFIG_ACCESS *i2c_config;
@@ -413,7 +413,7 @@
                                                        ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD *cd_path;
                                                        ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT *router_src_dst_table =
                                                                (ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT *)
-                                                               ((char *)ctx->bios + data_offset +
+                                                               (ctx->bios + data_offset +
                                                                 le16_to_cpu(router_obj->asObjects[k].usSrcDstTableOffset));
                                                        u8 *num_dst_objs = (u8 *)
                                                                ((u8 *)router_src_dst_table + 1 +
@@ -483,7 +483,7 @@
                                                    *record =
                                                    (ATOM_COMMON_RECORD_HEADER
                                                     *)
-                                                   ((char *)ctx->bios + data_offset +
+                                                   (ctx->bios + data_offset +
                                                     le16_to_cpu(con_obj->
                                                                 asObjects[j].
                                                                 usRecordOffset));
@@ -578,7 +578,7 @@
                struct amdgpu_pll *spll = &adev->clock.spll;
                struct amdgpu_pll *mpll = &adev->clock.mpll;
                union firmware_info *firmware_info =
-                       (union firmware_info *)((char *)mode_info->atom_context->bios +
+                       (union firmware_info *)(mode_info->atom_context->bios +
                                                data_offset);
                /* pixel clocks */
                ppll->reference_freq =
@@ -737,7 +737,7 @@
        if (amdgpu_atom_parse_data_header(mode_info->atom_context, index, &size,
                                   &frev, &crev, &data_offset)) {
                igp_info = (union igp_info *)
-                       ((char *)mode_info->atom_context->bios + data_offset);
+                       (mode_info->atom_context->bios + data_offset);
                switch (crev) {
                case 6:
                        switch (id) {
@@ -852,7 +852,7 @@
                                   &frev, &crev, &data_offset)) {
 
                ss_info =
-                       (union asic_ss_info *)((char *)mode_info->atom_context->bios + data_offset);
+                       (union asic_ss_info *)(mode_info->atom_context->bios + data_offset);
 
                switch (frev) {
                case 1:
@@ -1198,7 +1198,7 @@
                return -EINVAL;
 
        profile = (ATOM_ASIC_PROFILING_INFO_V2_1 *)
-               ((char *)adev->mode_info.atom_context->bios + data_offset);
+               (adev->mode_info.atom_context->bios + data_offset);
 
        switch (frev) {
        case 1:
@@ -1209,19 +1209,19 @@
                        if (size < sizeof(ATOM_ASIC_PROFILING_INFO_V2_1))
                                return -EINVAL;
                        leakage_bin = (u16 *)
-                               ((char *)adev->mode_info.atom_context->bios + data_offset +
+                               (adev->mode_info.atom_context->bios + data_offset +
                                 le16_to_cpu(profile->usLeakageBinArrayOffset));
                        vddc_id_buf = (u16 *)
-                               ((char *)adev->mode_info.atom_context->bios + data_offset +
+                               (adev->mode_info.atom_context->bios + data_offset +
                                 le16_to_cpu(profile->usElbVDDC_IdArrayOffset));
                        vddc_buf = (u16 *)
-                               ((char *)adev->mode_info.atom_context->bios + data_offset +
+                               (adev->mode_info.atom_context->bios + data_offset +
                                 le16_to_cpu(profile->usElbVDDC_LevelArrayOffset));
                        vddci_id_buf = (u16 *)
-                               ((char *)adev->mode_info.atom_context->bios + data_offset +
+                               (adev->mode_info.atom_context->bios + data_offset +
                                 le16_to_cpu(profile->usElbVDDCI_IdArrayOffset));
                        vddci_buf = (u16 *)
-                               ((char *)adev->mode_info.atom_context->bios + data_offset +
+                               (adev->mode_info.atom_context->bios + data_offset +
                                 le16_to_cpu(profile->usElbVDDCI_LevelArrayOffset));
 
                        if (profile->ucElbVDDC_Num > 0) {
@@ -1342,7 +1342,7 @@
        if (amdgpu_atom_parse_data_header(adev->mode_info.atom_context, index, &size,
                                   &frev, &crev, &data_offset)) {
                voltage_info = (union voltage_object_info *)
-                       ((char *)adev->mode_info.atom_context->bios + data_offset);
+                       (adev->mode_info.atom_context->bios + data_offset);
 
                switch (frev) {
                case 3:
@@ -1380,7 +1380,7 @@
        if (amdgpu_atom_parse_data_header(adev->mode_info.atom_context, index, &size,
                                   &frev, &crev, &data_offset)) {
                voltage_info = (union voltage_object_info *)
-                       ((char *)adev->mode_info.atom_context->bios + data_offset);
+                       (adev->mode_info.atom_context->bios + data_offset);
 
                switch (frev) {
                case 3:
@@ -1452,7 +1452,7 @@
        if (amdgpu_atom_parse_data_header(adev->mode_info.atom_context, index, &size,
                                   &frev, &crev, &data_offset)) {
                vram_info = (union vram_info *)
-                       ((char *)adev->mode_info.atom_context->bios + data_offset);
+                       (adev->mode_info.atom_context->bios + data_offset);
                switch (frev) {
                case 1:
                        DRM_ERROR("old table version %d, %d\n", frev, crev);
diff -r 656b00dd2ded -r 9d03e3b12dbf sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_encoders.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_encoders.c      Fri Feb 14 04:29:42 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_encoders.c      Fri Feb 14 04:30:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_atombios_encoders.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $   */
+/*     $NetBSD: amdgpu_atombios_encoders.c,v 1.2 2020/02/14 04:30:04 riastradh Exp $   */
 
 /*
  * Copyright 2007-11 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *          Alex Deucher
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_atombios_encoders.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_atombios_encoders.c,v 1.2 2020/02/14 04:30:04 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
@@ -1930,7 +1930,7 @@
        if (amdgpu_atom_parse_data_header(mode_info->atom_context, index, NULL,
                                   &frev, &crev, &data_offset)) {
                lvds_info =
-                       (union lvds_info *)((char *)mode_info->atom_context->bios + data_offset);
+                       (union lvds_info *)(mode_info->atom_context->bios + data_offset);
                lvds =
                    kzalloc(sizeof(struct amdgpu_encoder_atom_dig), GFP_KERNEL);
 
@@ -1995,11 +1995,11 @@
 
                        if ((frev == 1) && (crev < 2))
                                /* absolute */
-                               record = (u8 *)((char *)mode_info->atom_context->bios +
+                               record = (u8 *)(mode_info->atom_context->bios +
                                                le16_to_cpu(lvds_info->info.usModePatchTableOffset));
                        else
                                /* relative */
-                               record = (u8 *)((char *)mode_info->atom_context->bios +
+                               record = (u8 *)(mode_info->atom_context->bios +
                                                data_offset +
                                                le16_to_cpu(lvds_info->info.usModePatchTableOffset));
                        while (*record != ATOM_RECORD_END_TYPE) {
diff -r 656b00dd2ded -r 9d03e3b12dbf sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bo_list.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bo_list.c        Fri Feb 14 04:29:42 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bo_list.c        Fri Feb 14 04:30:04 2020 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index