]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/msm: dpu: Remove 'inline' from several functions
authorSean Paul <seanpaul@chromium.org>
Thu, 20 Sep 2018 14:58:16 +0000 (10:58 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 11 Dec 2018 17:51:29 +0000 (12:51 -0500)
Per chapter 15 of coding-style, removing 'inline' keyword from functions
that are larger than a typical macro. In a couple of cases I've
simplified the function and kept the inline.

Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h

index c5ba753d441cfe3930c883af165bc1bc821a3908..ae63590ad2d391c0e6172248af7e3d6ffb3c9d06 100644 (file)
@@ -53,7 +53,7 @@ static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc_state *cstate,
        return mode->hdisplay / cstate->num_mixers;
 }
 
-static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
+static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 {
        struct msm_drm_private *priv = crtc->dev->dev_private;
 
index 7dc181aabb4db2d0f6670f560424bd2c72cf96bb..4822602402f9a6520066193b070dcd6436bee646 100644 (file)
@@ -264,13 +264,7 @@ static inline int dpu_crtc_get_mixer_height(struct dpu_crtc *dpu_crtc,
  */
 static inline int dpu_crtc_frame_pending(struct drm_crtc *crtc)
 {
-       struct dpu_crtc *dpu_crtc;
-
-       if (!crtc)
-               return -EINVAL;
-
-       dpu_crtc = to_dpu_crtc(crtc);
-       return atomic_read(&dpu_crtc->frame_pending);
+       return crtc ? atomic_read(&to_dpu_crtc(crtc)->frame_pending) : -EINVAL;
 }
 
 /**
@@ -327,13 +321,7 @@ enum dpu_intf_mode dpu_crtc_get_intf_mode(struct drm_crtc *crtc);
 static inline enum dpu_crtc_client_type dpu_crtc_get_client_type(
                                                struct drm_crtc *crtc)
 {
-       struct dpu_crtc_state *cstate =
-                       crtc ? to_dpu_crtc_state(crtc->state) : NULL;
-
-       if (!cstate)
-               return NRT_CLIENT;
-
-       return RT_CLIENT;
+       return crtc && crtc->state ? RT_CLIENT : NRT_CLIENT;
 }
 
 /**
index 7b9620dc9c5422b36c615a4b3949346eb391d8e6..82c55efb500f206e3ff70c225690868651364c4d 100644 (file)
@@ -1374,7 +1374,7 @@ static void dpu_encoder_off_work(struct kthread_work *work)
  * phys: Pointer to physical encoder structure
  * extra_flush_bits: Additional bit mask to include in flush trigger
  */
-static inline void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc,
+static void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc,
                struct dpu_encoder_phys *phys, uint32_t extra_flush_bits)
 {
        struct dpu_hw_ctl *ctl;
@@ -1417,7 +1417,7 @@ static inline void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc,
  * _dpu_encoder_trigger_start - trigger start for a physical encoder
  * phys: Pointer to physical encoder structure
  */
-static inline void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys)
+static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys)
 {
        if (!phys) {
                DPU_ERROR("invalid argument(s)\n");
index 283a2491f3e36ca74387443ac1377fcea53b4043..b3c68c4fcc8e9383096e072766dc48008b098f03 100644 (file)
@@ -110,7 +110,7 @@ static void drm_mode_to_intf_timing_params(
         */
 }
 
-static inline u32 get_horizontal_total(const struct intf_timing_params *timing)
+static u32 get_horizontal_total(const struct intf_timing_params *timing)
 {
        u32 active = timing->xres;
        u32 inactive =
@@ -119,7 +119,7 @@ static inline u32 get_horizontal_total(const struct intf_timing_params *timing)
        return active + inactive;
 }
 
-static inline u32 get_vertical_total(const struct intf_timing_params *timing)
+static u32 get_vertical_total(const struct intf_timing_params *timing)
 {
        u32 active = timing->yres;
        u32 inactive =
index d3f8b929af65317808c2186ef1a3c2f2446d3bc3..8fa601a9abbfb34f7de2cdefb4139e0136f15993 100644 (file)
@@ -124,7 +124,7 @@ static inline void dpu_hw_ctl_trigger_flush(struct dpu_hw_ctl *ctx)
        DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, ctx->pending_flush_mask);
 }
 
-static inline uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx,
+static uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx,
        enum dpu_sspp sspp)
 {
        uint32_t flushbits = 0;
@@ -179,7 +179,7 @@ static inline uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx,
        return flushbits;
 }
 
-static inline uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx,
+static uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx,
        enum dpu_lm lm)
 {
        uint32_t flushbits = 0;
@@ -212,7 +212,7 @@ static inline uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx,
        return flushbits;
 }
 
-static inline int dpu_hw_ctl_get_bitmask_intf(struct dpu_hw_ctl *ctx,
+static int dpu_hw_ctl_get_bitmask_intf(struct dpu_hw_ctl *ctx,
                u32 *flushbits, enum dpu_intf intf)
 {
        switch (intf) {
index acb8dc8acaa59687d075f01e00480dae80992d9a..dbe48e0064148acc7abe66b9c7fb0d59026c7b6b 100644 (file)
@@ -64,16 +64,10 @@ static struct dpu_lm_cfg *_lm_offset(enum dpu_lm mixer,
 static inline int _stage_offset(struct dpu_hw_mixer *ctx, enum dpu_stage stage)
 {
        const struct dpu_lm_sub_blks *sblk = ctx->cap->sblk;
-       int rc;
-
-       if (stage == DPU_STAGE_BASE)
-               rc = -EINVAL;
-       else if (stage <= sblk->maxblendstages)
-               rc = sblk->blendstage_base[stage - DPU_STAGE_0];
-       else
-               rc = -EINVAL;
+       if (stage != DPU_STAGE_BASE && stage <= sblk->maxblendstages)
+               return sblk->blendstage_base[stage - DPU_STAGE_0];
 
-       return rc;
+       return -EINVAL;
 }
 
 static void dpu_hw_lm_setup_out(struct dpu_hw_mixer *ctx,
index c25b52a6b21989828cd8e76428342fd0734e1469..8745018ffdd62af89c6d9bf217c7e6c651222d20 100644 (file)
 /* traffic shaper clock in Hz */
 #define TS_CLK                 19200000
 
-static inline int _sspp_subblk_offset(struct dpu_hw_pipe *ctx,
+static int _sspp_subblk_offset(struct dpu_hw_pipe *ctx,
                int s_id,
                u32 *idx)
 {
index d77a8cb1540484157f75113fbfae5ba7dbba0eb9..e61c3b6fd7253cf1ab7802a1b9527e62a6045204 100644 (file)
@@ -137,7 +137,7 @@ static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane)
  * @src_wdith:         width of source buffer
  * Return: fill level corresponding to the source buffer/format or 0 if error
  */
-static inline int _dpu_plane_calc_fill_level(struct drm_plane *plane,
+static int _dpu_plane_calc_fill_level(struct drm_plane *plane,
                const struct dpu_format *fmt, u32 src_width)
 {
        struct dpu_plane *pdpu, *tmp;
@@ -441,7 +441,7 @@ static inline struct msm_gem_address_space *_dpu_plane_get_aspace(
        return kms->base.aspace;
 }
 
-static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
+static void _dpu_plane_set_scanout(struct drm_plane *plane,
                struct dpu_plane_state *pstate,
                struct dpu_hw_pipe_cfg *pipe_cfg,
                struct drm_framebuffer *fb)
@@ -525,7 +525,7 @@ static void _dpu_plane_setup_scaler3(struct dpu_plane *pdpu,
        scale_cfg->enable = 1;
 }
 
-static inline void _dpu_plane_setup_csc(struct dpu_plane *pdpu)
+static void _dpu_plane_setup_csc(struct dpu_plane *pdpu)
 {
        static const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = {
                {
index 1a35dfb4a4e5119912bf8bacf47ad6185f10dc17..75470ee5b18f72f4fbfb266777a319ed22e35d38 100644 (file)
@@ -820,7 +820,7 @@ enum color_fmts {
  * Progressive: width
  * Interlaced: width
  */
-static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width)
+static unsigned int VENUS_Y_STRIDE(int color_fmt, int width)
 {
        unsigned int alignment, stride = 0;
 
@@ -862,7 +862,7 @@ invalid_input:
  * Progressive: width
  * Interlaced: width
  */
-static inline unsigned int VENUS_UV_STRIDE(int color_fmt, int width)
+static unsigned int VENUS_UV_STRIDE(int color_fmt, int width)
 {
        unsigned int alignment, stride = 0;
 
@@ -904,7 +904,7 @@ invalid_input:
  * Progressive: height
  * Interlaced: (height+1)>>1
  */
-static inline unsigned int VENUS_Y_SCANLINES(int color_fmt, int height)
+static unsigned int VENUS_Y_SCANLINES(int color_fmt, int height)
 {
        unsigned int alignment, sclines = 0;
 
@@ -938,7 +938,7 @@ invalid_input:
  * Progressive: height
  * Interlaced: (height+1)>>1
  */
-static inline unsigned int VENUS_UV_SCANLINES(int color_fmt, int height)
+static unsigned int VENUS_UV_SCANLINES(int color_fmt, int height)
 {
        unsigned int alignment, sclines = 0;
 
@@ -974,7 +974,7 @@ invalid_input:
  * Progressive: width
  * Interlaced: width
  */
-static inline unsigned int VENUS_Y_META_STRIDE(int color_fmt, int width)
+static unsigned int VENUS_Y_META_STRIDE(int color_fmt, int width)
 {
        int y_tile_width = 0, y_meta_stride = 0;
 
@@ -1007,7 +1007,7 @@ invalid_input:
  * Progressive: height
  * Interlaced: (height+1)>>1
  */
-static inline unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int height)
+static unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int height)
 {
        int y_tile_height = 0, y_meta_scanlines = 0;
 
@@ -1040,7 +1040,7 @@ invalid_input:
  * Progressive: width
  * Interlaced: width
  */
-static inline unsigned int VENUS_UV_META_STRIDE(int color_fmt, int width)
+static unsigned int VENUS_UV_META_STRIDE(int color_fmt, int width)
 {
        int uv_tile_width = 0, uv_meta_stride = 0;
 
@@ -1073,7 +1073,7 @@ invalid_input:
  * Progressive: height
  * Interlaced: (height+1)>>1
  */
-static inline unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int height)
+static unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int height)
 {
        int uv_tile_height = 0, uv_meta_scanlines = 0;
 
@@ -1099,7 +1099,7 @@ invalid_input:
        return uv_meta_scanlines;
 }
 
-static inline unsigned int VENUS_RGB_STRIDE(int color_fmt, int width)
+static unsigned int VENUS_RGB_STRIDE(int color_fmt, int width)
 {
        unsigned int alignment = 0, stride = 0, bpp = 4;
 
@@ -1128,7 +1128,7 @@ invalid_input:
        return stride;
 }
 
-static inline unsigned int VENUS_RGB_SCANLINES(int color_fmt, int height)
+static unsigned int VENUS_RGB_SCANLINES(int color_fmt, int height)
 {
        unsigned int alignment = 0, scanlines = 0;
 
@@ -1154,7 +1154,7 @@ invalid_input:
        return scanlines;
 }
 
-static inline unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int width)
+static unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int width)
 {
        int rgb_tile_width = 0, rgb_meta_stride = 0;
 
@@ -1178,7 +1178,7 @@ invalid_input:
        return rgb_meta_stride;
 }
 
-static inline unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int height)
+static unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int height)
 {
        int rgb_tile_height = 0, rgb_meta_scanlines = 0;