* [PATCH RESEND 2/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL [not found] <1355852048-23188-1-git-send-email-linux@prisktech.co.nz> @ 2012-12-18 17:34 ` Tony Prisk 2012-12-18 18:48 ` Dan Carpenter 2012-12-18 17:34 ` [PATCH RESEND 3/6] " Tony Prisk 1 sibling, 1 reply; 8+ messages in thread From: Tony Prisk @ 2012-12-18 17:34 UTC (permalink / raw) To: kernel-janitors Cc: linux-arm-kernel, linux-kernel, Tony Prisk, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel Resend to include mailing lists. Replace IS_ERR_OR_NULL with IS_ERR on clk_get results. In the fail: path of mixer_resources_init() and vp_resources_init() the first clk tested cannot be NULL either, so IS_ERR_OR_NULL is removed from these as well. Other clocks may still be NULL as they haven't been clk_get'd yet. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> CC: Inki Dae <inki.dae@samsung.com> CC: Joonyoung Shim <jy0922.shim@samsung.com> CC: Seung-Woo Kim <sw0312.kim@samsung.com> CC: Kyungmin Park <kyungmin.park@samsung.com> CC: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/exynos/exynos_mixer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index e7fbb82..dbd97c0 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -972,14 +972,14 @@ static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx, spin_lock_init(&mixer_res->reg_slock); mixer_res->mixer = clk_get(dev, "mixer"); - if (IS_ERR_OR_NULL(mixer_res->mixer)) { + if (IS_ERR(mixer_res->mixer)) { dev_err(dev, "failed to get clock 'mixer'\n"); ret = -ENODEV; goto fail; } mixer_res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); - if (IS_ERR_OR_NULL(mixer_res->sclk_hdmi)) { + if (IS_ERR(mixer_res->sclk_hdmi)) { dev_err(dev, "failed to get clock 'sclk_hdmi'\n"); ret = -ENODEV; goto fail; @@ -1019,7 +1019,7 @@ static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx, fail: if (!IS_ERR_OR_NULL(mixer_res->sclk_hdmi)) clk_put(mixer_res->sclk_hdmi); - if (!IS_ERR_OR_NULL(mixer_res->mixer)) + if (!IS_ERR(mixer_res->mixer)) clk_put(mixer_res->mixer); return ret; } @@ -1034,19 +1034,19 @@ static int __devinit vp_resources_init(struct exynos_drm_hdmi_context *ctx, int ret; mixer_res->vp = clk_get(dev, "vp"); - if (IS_ERR_OR_NULL(mixer_res->vp)) { + if (IS_ERR(mixer_res->vp)) { dev_err(dev, "failed to get clock 'vp'\n"); ret = -ENODEV; goto fail; } mixer_res->sclk_mixer = clk_get(dev, "sclk_mixer"); - if (IS_ERR_OR_NULL(mixer_res->sclk_mixer)) { + if (IS_ERR(mixer_res->sclk_mixer)) { dev_err(dev, "failed to get clock 'sclk_mixer'\n"); ret = -ENODEV; goto fail; } mixer_res->sclk_dac = clk_get(dev, "sclk_dac"); - if (IS_ERR_OR_NULL(mixer_res->sclk_dac)) { + if (IS_ERR(mixer_res->sclk_dac)) { dev_err(dev, "failed to get clock 'sclk_dac'\n"); ret = -ENODEV; goto fail; @@ -1077,7 +1077,7 @@ fail: clk_put(mixer_res->sclk_dac); if (!IS_ERR_OR_NULL(mixer_res->sclk_mixer)) clk_put(mixer_res->sclk_mixer); - if (!IS_ERR_OR_NULL(mixer_res->vp)) + if (!IS_ERR(mixer_res->vp)) clk_put(mixer_res->vp); return ret; } -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH RESEND 2/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL 2012-12-18 17:34 ` [PATCH RESEND 2/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL Tony Prisk @ 2012-12-18 18:48 ` Dan Carpenter 0 siblings, 0 replies; 8+ messages in thread From: Dan Carpenter @ 2012-12-18 18:48 UTC (permalink / raw) To: Tony Prisk Cc: kernel-janitors, linux-arm-kernel, linux-kernel, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel On Wed, Dec 19, 2012 at 06:34:04AM +1300, Tony Prisk wrote: > Resend to include mailing lists. These kind of comments should go under the Signed of by line under a "---" line. They will be removed by git-am instead of being preserved in the git log. Signed-off-by bla bla blah --- Commments... <patch> regards, dan carpenter ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH RESEND 3/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL [not found] <1355852048-23188-1-git-send-email-linux@prisktech.co.nz> 2012-12-18 17:34 ` [PATCH RESEND 2/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL Tony Prisk @ 2012-12-18 17:34 ` Tony Prisk 2012-12-18 18:39 ` Dan Carpenter 1 sibling, 1 reply; 8+ messages in thread From: Tony Prisk @ 2012-12-18 17:34 UTC (permalink / raw) To: kernel-janitors Cc: Inki Dae, Joonyoung Shim, Seung-Woo Kim, linux-kernel, dri-devel, Tony Prisk, Kyungmin Park, linux-arm-kernel Resend to include mailing lists. Replace IS_ERR_OR_NULL with IS_ERR on clk_get results. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> CC: Inki Dae <inki.dae@samsung.com> CC: Joonyoung Shim <jy0922.shim@samsung.com> CC: Seung-Woo Kim <sw0312.kim@samsung.com> CC: Kyungmin Park <kyungmin.park@samsung.com> CC: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/exynos/exynos_hdmi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 2c115f8..557ef2f 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2167,27 +2167,27 @@ static int __devinit hdmi_resources_init(struct hdmi_context *hdata) /* get clocks, power */ res->hdmi = clk_get(dev, "hdmi"); - if (IS_ERR_OR_NULL(res->hdmi)) { + if (IS_ERR(res->hdmi)) { DRM_ERROR("failed to get clock 'hdmi'\n"); goto fail; } res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); - if (IS_ERR_OR_NULL(res->sclk_hdmi)) { + if (IS_ERR(res->sclk_hdmi)) { DRM_ERROR("failed to get clock 'sclk_hdmi'\n"); goto fail; } res->sclk_pixel = clk_get(dev, "sclk_pixel"); - if (IS_ERR_OR_NULL(res->sclk_pixel)) { + if (IS_ERR(res->sclk_pixel)) { DRM_ERROR("failed to get clock 'sclk_pixel'\n"); goto fail; } res->sclk_hdmiphy = clk_get(dev, "sclk_hdmiphy"); - if (IS_ERR_OR_NULL(res->sclk_hdmiphy)) { + if (IS_ERR(res->sclk_hdmiphy)) { DRM_ERROR("failed to get clock 'sclk_hdmiphy'\n"); goto fail; } res->hdmiphy = clk_get(dev, "hdmiphy"); - if (IS_ERR_OR_NULL(res->hdmiphy)) { + if (IS_ERR(res->hdmiphy)) { DRM_ERROR("failed to get clock 'hdmiphy'\n"); goto fail; } -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH RESEND 3/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL 2012-12-18 17:34 ` [PATCH RESEND 3/6] " Tony Prisk @ 2012-12-18 18:39 ` Dan Carpenter 2012-12-18 18:52 ` Tony Prisk 0 siblings, 1 reply; 8+ messages in thread From: Dan Carpenter @ 2012-12-18 18:39 UTC (permalink / raw) To: Tony Prisk Cc: kernel-janitors, linux-arm-kernel, linux-kernel, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel On Wed, Dec 19, 2012 at 06:34:05AM +1300, Tony Prisk wrote: > Resend to include mailing lists. > > Replace IS_ERR_OR_NULL with IS_ERR on clk_get results. > The original code is correct. clk_get() can return NULL depending on the .config. regards, dan carpenter ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RESEND 3/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL 2012-12-18 18:39 ` Dan Carpenter @ 2012-12-18 18:52 ` Tony Prisk 2012-12-18 19:03 ` Dan Carpenter 0 siblings, 1 reply; 8+ messages in thread From: Tony Prisk @ 2012-12-18 18:52 UTC (permalink / raw) To: Dan Carpenter Cc: kernel-janitors, linux-arm-kernel, linux-kernel, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel, Mike Turquette On Tue, 2012-12-18 at 21:39 +0300, Dan Carpenter wrote: > On Wed, Dec 19, 2012 at 06:34:05AM +1300, Tony Prisk wrote: > > Resend to include mailing lists. > > > > Replace IS_ERR_OR_NULL with IS_ERR on clk_get results. > > > > The original code is correct. clk_get() can return NULL depending > on the .config. > > regards, > dan carpenter Thanks for than Dan, Arguably that seems like an incorrect behaviour on the part of the clock subsystem given that the 'proper' function has kernel doc: * Returns a struct clk corresponding to the clock producer, or * valid IS_ERR() condition containing errno. Therefore the 'empty' version should adhere to the same rules, and not return NULL. I've cc'd Mike Turquette as well for his thoughts. Regards Tony P ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RESEND 3/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL 2012-12-18 18:52 ` Tony Prisk @ 2012-12-18 19:03 ` Dan Carpenter 2012-12-18 19:11 ` Tony Prisk 0 siblings, 1 reply; 8+ messages in thread From: Dan Carpenter @ 2012-12-18 19:03 UTC (permalink / raw) To: Tony Prisk Cc: Mike Turquette, kernel-janitors, Seung-Woo Kim, linux-kernel, dri-devel, Kyungmin Park, linux-arm-kernel I don't care either way, but being different from the documentation is less bad than crashing which is what your patch does. Please be more careful in the future. regards, dan carpenter ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RESEND 3/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL 2012-12-18 19:03 ` Dan Carpenter @ 2012-12-18 19:11 ` Tony Prisk 2012-12-18 19:39 ` Tony Prisk 0 siblings, 1 reply; 8+ messages in thread From: Tony Prisk @ 2012-12-18 19:11 UTC (permalink / raw) To: Dan Carpenter Cc: kernel-janitors, linux-arm-kernel, linux-kernel, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel, Mike Turquette On Tue, 2012-12-18 at 22:03 +0300, Dan Carpenter wrote: > I don't care either way, but being different from the documentation > is less bad than crashing which is what your patch does. Please > be more careful in the future. > > regards, > dan carpenter Critism accepted. Given that the driver depends on (PLAT_SAMSUNG || ARCH_MULTIPLATFORM), and multiplatform select COMMON_CLK and PLAT_SAMSUNG is selected only by ARCH_S3C64XX which has HAVE_CLK I didn't see a problem here. Your point is still valid and I will sort it out with Mike first. Regards Tony P ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RESEND 3/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL 2012-12-18 19:11 ` Tony Prisk @ 2012-12-18 19:39 ` Tony Prisk 0 siblings, 0 replies; 8+ messages in thread From: Tony Prisk @ 2012-12-18 19:39 UTC (permalink / raw) To: Dan Carpenter Cc: kernel-janitors, linux-arm-kernel, linux-kernel, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel, Mike Turquette On Wed, 2012-12-19 at 08:11 +1300, Tony Prisk wrote: > On Tue, 2012-12-18 at 22:03 +0300, Dan Carpenter wrote: > > I don't care either way, but being different from the documentation > > is less bad than crashing which is what your patch does. Please > > be more careful in the future. > > > > regards, > > dan carpenter > > Critism accepted. > > Given that the driver depends on (PLAT_SAMSUNG || ARCH_MULTIPLATFORM), > and multiplatform select COMMON_CLK and PLAT_SAMSUNG is selected only by > ARCH_S3C64XX which has HAVE_CLK I didn't see a problem here. > > Your point is still valid and I will sort it out with Mike first. > > Regards > Tony P Actually, I was wrong here - PLAT_SAMSUNG is selectable via PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P but all these options (or the options that select them) seem to select a clock system as well, hence still no reason for a crash. Regards Tony P ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-12-18 19:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1355852048-23188-1-git-send-email-linux@prisktech.co.nz>
2012-12-18 17:34 ` [PATCH RESEND 2/6] clk: exynos: Fix incorrect usage of IS_ERR_OR_NULL Tony Prisk
2012-12-18 18:48 ` Dan Carpenter
2012-12-18 17:34 ` [PATCH RESEND 3/6] " Tony Prisk
2012-12-18 18:39 ` Dan Carpenter
2012-12-18 18:52 ` Tony Prisk
2012-12-18 19:03 ` Dan Carpenter
2012-12-18 19:11 ` Tony Prisk
2012-12-18 19:39 ` Tony Prisk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox